473,414 Members | 1,674 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

_doPostBack jscript with dropdownList manually

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



Aug 30 '07 #1
3 1667
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.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Ghistos" <Gh*****@discussions.microsoft.comwrote in message
news:06**********************************@microsof t.com...
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



Aug 30 '07 #2
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.
Aug 30 '07 #3
Well,

tks, I find my solution

"Ghistos" wrote:
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


Aug 30 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: DotNetJunky | last post by:
I have built a control that runs an on-line help system. Depending on the category you selected via dropdownlist, it goes out and gets the child subcategories, and if there are any, adds a new...
0
by: PJ | last post by:
I have several dropdownlist controls in a placeholder on my form. Certain events will show this place holder and populate the values of the items collection of the dropdownlist controls. A...
0
by: Jim Heavey | last post by:
Hello, I am running into a situation where my application is failing and it is showing me "Jscript code" when it fails. The error message I get in a message box is "Microsoft JScript runtime...
5
by: Øyvind Isaksen | last post by:
When I bind the dropdownlist-control to a datareader, it displays all the data (from the database) in the dropdownlist. My question is: How do I insert a "<option value="">Choose...</option>" in...
3
by: Carlos Lozano | last post by:
Hello, I am having a problem getting the selectedValue from a dropdownlist that is populated with a dataReader and just can't see the problem. I did the following: dim dr as DataReader dr...
1
by: DJ | last post by:
I have a DropDownList in Visual Web Developer that is databound to a SQL Database. Whenever the web page is opened the DropDownList is automatically filled with the first item in the table. My...
3
by: Mark Rae | last post by:
Hi, Is it possible to use a Dictionary<int, stringor even Dictionary<string, stringas the DataSource for a DropDownList directly, i.e. without having to iterate through the the Dictionary's...
1
by: rvidal | last post by:
Hi. the javascript:_dopostback was removed from my machine after using an antivirus. As we know javascript:_dopostback comes as default for any LinkButton. My question is,how do I restore...
18
by: Redhairs | last post by:
Is it possible to get DropDownList.SelectedValue in Page_PreInit() event during the postback?
7
by: Cirene | last post by:
I have a dropdownlist. I want to fill it with times (using vb.net code). I want the entries in the ddl to be from "8:00 AM" to "5:00 PM", incrementing every half hour. I know I could type in...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.