.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

Dropdownlist selection problem

Posted By: venu     Posted Date: July 30, 2011    Points:5   Category :ASP.Net
Hi Friends!

I have a problem .In a page i have 2 drop down lists like Gender,Maritalstatus and also have some Radiobutton lists.After data insertion if i want to change any value like changing Gender Male to Female or Marital status or Radio button the values are pointing the previous values only.so that in the data base data is not updating.Can any body help me on this.

Regards
------
Venu

Responses
Author: Sasi Prabhu             
Posted Date: July 30, 2011     Points: 20   

Try

Check the Autopastback propery as False.


Check are you using the
if(!ispostback())
{function();}

inside the Page_Load event.


Check are you call any function to bind the data to controls before update command

Thanks & Regards,
Sasi Prabhu.
Author: Gowthammanju             
Posted Date: July 30, 2011     Points: 20   

Hey

Postback in an event that is triggered when a action is performed by a contol on a asp.net page. for eg. when you click on a button the data on the page is posted back to the server for processing.

Is Postback is normally used on page _load event to detect if the page is getting generated due to postback requested by a control on the page or if the page is getting loaded for the first time.


so its better to include these property in page_load event

Thanks & Regards,
GowthamManju
Chennai



Mark if the answer is true
Author: Gowthammanju             
Posted Date: July 30, 2011     Points: 20   



u also need to set autopostback property of radiobutton and dropdown as true der by it solves ur problem




By setting AutoPostBack to true, the page will be posted back to the server when the radio button is checked.


<asp:radiobutton id="mFederal" groupname="RadioButtons"  runat="server"  autopostback="true"   checked="true" />


Thanks & Regards,
GowthamManju
Chennai



Mark if the answer is true
Author: Ravi Ranjan Kumar             
Posted Date: July 30, 2011     Points: 20   

its not clear for me what do you want to do. if possible show your some codes in your question or be more specific while asking question.
I hope you will come back soon with a complete question.

Thanks & Regards
Ravi Ranjan Kumar
http://raviranjankr.wordpress.com
Author: venu             
Posted Date: July 31, 2011     Points: 20   

Thank you friends for your replay.Ravi Ranjan Kumar go through this link i think it will clear the question.
http://www.immigrationmedical.com/survey.
Friends i tried with autopost back=true property also.It is new to me.I have ddls like

<asp:DropDownList id="ddlGender" runat="server">
<asp:ListItem>Male</asp:ListItem>
<asp:ListItem>FeMale</asp:ListItem>
</asp:DropDownList>
like this i have controls when first time i am entering data it is saving exactly but after come back to prev page and tryng change ddl or radio button values it is keeping the same value in controls so it is updatng with old value only

Regards
-----------
Venu

Thanks & Regards
-----------------
Venu
Dotnet Programmer
Author: Ravi Ranjan Kumar             
Posted Date: July 31, 2011     Points: 20   

hey! veno I found a link having similar question with some nice solution that might help you.
take a look
http://forums.asp.net/p/1394100/2989247.aspx
have a go through the thread.
you should set AutoPostBack property to True from Properties of ComboBox to retain value after postback. its default value is False.
it its can't resolve your problem please show some code that we can map it.

Thanks & Regards
Ravi Ranjan Kumar
http://raviranjankr.wordpress.com
Author: venu             
Posted Date: August 01, 2011     Points: 20   

Hi Friends!

I really thank full to you all for your kind replay.I solved my issue.

Thanks & Regards
----------------
Venu

Thanks & Regards
-----------------
Venu
Dotnet Programmer


Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend