Click here to Skip to main content
15,921,169 members
Home / Discussions / Web Development
   

Web Development

 
Questionjavascript parent iframe access problem Pin
umeshdaiya26-Oct-08 22:32
umeshdaiya26-Oct-08 22:32 
QuestionHow to create a ErrorProvider in Web Form? Pin
meki_211826-Oct-08 20:41
meki_211826-Oct-08 20:41 
AnswerRe: How to create a ErrorProvider in Web Form? Pin
Eduard Keilholz27-Oct-08 22:42
Eduard Keilholz27-Oct-08 22:42 
Questionuse of ajax in asp.net Pin
indukala24-Oct-08 22:18
indukala24-Oct-08 22:18 
AnswerRe: use of ajax in asp.net Pin
Shyam Bharath27-Oct-08 1:39
Shyam Bharath27-Oct-08 1:39 
AnswerRe: use of ajax in asp.net Pin
leckey27-Oct-08 10:06
leckey27-Oct-08 10:06 
GeneralRe: use of ajax in asp.net Pin
Paul Conrad29-Oct-08 8:01
professionalPaul Conrad29-Oct-08 8:01 
AnswerRe: use of ajax in asp.net Pin
Aman Bhullar3-Nov-08 23:43
Aman Bhullar3-Nov-08 23:43 
QuestionMoving xml file fails Pin
Ekjon24-Oct-08 7:44
Ekjon24-Oct-08 7:44 
AnswerRe: Moving xml file fails Pin
Shog925-Oct-08 5:59
sitebuilderShog925-Oct-08 5:59 
GeneralRe: Moving xml file fails Pin
Ekjon27-Oct-08 5:18
Ekjon27-Oct-08 5:18 
GeneralRe: Moving xml file fails Pin
Shog927-Oct-08 5:26
sitebuilderShog927-Oct-08 5:26 
GeneralRe: Moving xml file fails [modified] Pin
Ekjon27-Oct-08 10:03
Ekjon27-Oct-08 10:03 
QuestionAdding a border to an image Pin
Brendan Vogt24-Oct-08 6:22
Brendan Vogt24-Oct-08 6:22 
AnswerRe: Adding a border to an image Pin
Mohammad Dayyan24-Oct-08 8:39
Mohammad Dayyan24-Oct-08 8:39 
AnswerRe: Adding a border to an image Pin
Drew Stainton24-Oct-08 8:42
Drew Stainton24-Oct-08 8:42 
QuestionJavaScript Selection/Range Problem [modified] Pin
Lea Hayes24-Oct-08 0:27
Lea Hayes24-Oct-08 0:27 
AnswerRe: JavaScript Selection/Range Problem Pin
Aman Bhullar3-Nov-08 23:50
Aman Bhullar3-Nov-08 23:50 
QuestionRegular Expression Pin
ganeshMohan23-Oct-08 18:51
ganeshMohan23-Oct-08 18:51 
AnswerRe: Regular Expression Pin
Mohammad Dayyan24-Oct-08 2:47
Mohammad Dayyan24-Oct-08 2:47 
GeneralRe: Regular Expression Pin
Paul Conrad24-Oct-08 5:46
professionalPaul Conrad24-Oct-08 5:46 
QuestionDelegates in C# Pin
jainvidhya8423-Oct-08 3:34
jainvidhya8423-Oct-08 3:34 
AnswerRe: Delegates in C# Pin
Aman Bhullar3-Nov-08 23:55
Aman Bhullar3-Nov-08 23:55 
QuestionCannot retrieve the value from my session (cast type error) Pin
Aldeareao23-Oct-08 2:34
Aldeareao23-Oct-08 2:34 
Hey everyone,

recently I am workign on a project where people are able to search wines and later get them from my database. I store the variables from the search form in Session which i later retrieve in the next page (I couldnt use the query string here since its too small). However i get a problem in retrieving my data.





First of all my search field put the data to a session, here is the code.

public partial class catalogus : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
protected void BTNzoeken_Click(object sender, EventArgs e)
{
Session["searchkleur"] = DDLkleur.SelectedValue;
Session["searchland"] = DDLland.SelectedValue;
Session["searchdruifsoort"] = TXTdruifsoort.Text;
Session["searchregio"] = DDLregio.SelectedValue;
Session["searchjaar"] = TXTjaar.Text;
Session["searchinhoud"] = DDLinhoud.SelectedValue;
Session["searchprijs"] = DDLprijs.SelectedValue;
Session["searchoverig"] = TXToverig.Text;
Session["searchwijnnaam"] = TXTwijnnaam.Text;
Session["searchproducent"] = TXTproducent.Text;

Response.Redirect("resultaten.aspx");
}
}





After this i will arrive at the resultaten.aspx page which holds the following code

public partial class resultaten : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (Session["searchkleur"] != null)
{
string VARkleur = Session["searchkleur"].ToString();
string VARland = Session["searchland"].ToString();
System.Convert.ToInt32(VARland);
string VARdruifsoort = Session["searchdruifsoort"].ToString();
string VARregio = Session["searchregio"].ToString();
string VARjaar = Session["searchjaar"].ToString();
string VARinhoud = Session["searchinhoud"].ToString();
string VARprijs = Session["searchprijs"].ToString();
string VARoverig = Session["searchoverig"].ToString();
string VARwijnnaam = Session["searchwijnnaam"].ToString();
string VARproducent = Session["searchproducent"].ToString();

LBLtest.Text = "Kleur " + VARkleur + "<br />Land " + VARland + "<br />Druifsoort " + VARdruifsoort + "<br />Regio " + VARregio + "<br />Jaar " + VARjaar + "<br />Inhoud " + VARinhoud + "<br />Prijs " + VARprijs + "<br />Overig " + VARoverig + "<br />Wijnnaam " + VARwijnnaam + "<br />Producent " + VARproducent;
}
}
}



and here's my aspx part with the SQL command:

<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ConnectionStrings:WijnhuisMDFConnectionString %>"
SelectCommand="SELECT [text] FROM [texten] WHERE textID = 26">
</asp:SqlDataSource>

<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" BorderStyle="None"
DataSourceID="SqlDataSource2" GridLines="None" Width="240px">
<Columns>

<asp:BoundField DataField="text" HtmlEncode="False" SortExpression="text" />
</Columns>
</asp:GridView>





now i ve got 2 error messages: First one says that my landId cannot be converted to an integer so the session variable i stored as a string can't be converted to an int although i ve told C# to convert it.

2: i get an FormatException was unhandled y user code.

Does anyone know's whats wrong or how to solve it? I can share the project files if needed. Thanks in advance for your help Smile | :)
AnswerRe: Cannot retrieve the value from my session (cast type error) Pin
Ashfield23-Oct-08 23:52
Ashfield23-Oct-08 23:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.