XXX Chats

mature dating cambridge

Updating a session variable without postback

Hi, You are creating a new dropdownlist every time the page loads.

I was hoping there was a simple solution to be able to have the autopostback update the correct selectedvalue without have to use the selectedindexchanged and querystring or session variable. As you enable view state the dropdown list content will be restored on postback. you would have to populate the list from the database every time the page posts back! Get("__EVENTARGUMENT") Process User Interface Data(control Name, args) If (control Name = "txt Test" And Also args. Thanks for replying binukumar, but I'm not sure where you mean to use this code. Text=Session("Usr Email") I think you wrong direction, why in not is postback page load event you set session from textbox?) that I store in the session's variable after updating/inserting. 4, Second or more time (if I CHANGE NOTHING) all it's OK. Write Line("In not Previous Request Quotenew2") Session("Usr Name") = wrd1. Request Quote=New") End If end sub Private Sub Text Boxes_Text Changed(By Val sender As Object, By Val e As Event Args) Handles wrd1. Text = Session("counter") will still be executed, so now Text Box1. If thats what you intended the final code to look like.. Text = Session("counter") = 1 After Page_Load, Add Button's event handler is fired, which will increase Session("counter") by 1, so now you have: Session("counter") = 2 But remeber Text Box1. Query String("Request Quote") If Query Stg = "Previous" Then wrd1. Selected Value = Session("Category Select") End If End Sub And that's your problem. Is Post Back) block, otherwise you'd be resetting the value of the textbox and so causing the subsequent error when trying to set the session value after.

Comments Updating a session variable without postback