Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / August 2007

Tip: Looking for answers? Try searching our database.

_doPostBack jscript with dropdownList manually

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ghistos - 30 Aug 2007 18:12 GMT
Hi,

I have a dropdown list in a user control with values(10) from my DB. I also
have in this ascx other controls (DatePicker, TextBox...) to be filled.

But, if the user select  one particular value from this dropdown, it
indicates to me that the user control have to hide some fields and add others.

So, all I want is to make a _postback to the server to redefines the form
only with this particular value.

Otherwise, if the user choose all the other values, he can continue to fill
the fields and push on the Submit button at the end for the postback.

Tks all
Eliyahu Goldin - 30 Aug 2007 18:23 GMT
You will need to handle javascript onchange event for the ddl. Detect in the
event when the desired item is selected and call myForm.submit(). This will
initiate a postback.

Signature

Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net

> Hi,
>
[quoted text clipped - 14 lines]
>
> Tks all
Ghistos - 30 Aug 2007 18:42 GMT
Well,

I really don't know how to do this.

In my User Control Page_Load I know I have to do someting like that
ddlTypeTransaction.Attributes.Add("onchange", "??");

?? don't know exactly what do here

On my Default page I have this too
       HtmlGenericControl Include = new HtmlGenericControl("script");
       Include.Attributes.Add("type", "text/javascript");
       Include.Attributes.Add("src", Page.ResolveUrl("~/Scripts/jlr.js"));
       this.Page.Header.Controls.Add(Include);

So now, I have to write a javascript function to handle my ddl, verify my
value
and then do a submit if it's necessary.
Ghistos - 30 Aug 2007 19:48 GMT
Well,

tks, I find my solution

> Hi,
>
[quoted text clipped - 11 lines]
>
> Tks all

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.