|
Because by default this item is selected i.e first item in Drop down is always selected
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
AutoPostBack Property is already true.
|
|
|
|
|
Gagan Deep Garg wrote: '07
AutoPostBack Property is already true.
i didn't say anything about this
See that event will fire only when selected Index changed as it is in name. And by default first item is selected so it will not fire untill you select another item
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Here is a piece of code that works fine in my system. just check with this you are doing it right...
HTML
-----
<-asp:dropdownlist id="DropDownList1" runat="server"
0nSelectedIndexChanged="dropdownlist_SelectedIndexChanged" AutoPostBack="True"></asp:dropdownlist>
Code-Behind
------------
private void Page_Load(object sender, System.EventArgs e)
{
if (!Page.IsPostBack) {
DropDownList1.Items.Insert(0, new ListItem("First", "1"));
DropDownList1.Items.Insert(1, new ListItem("Second", "2"));
DropDownList1.Items.Insert(2, new ListItem("Third", "3"));
}
}
public void dropdownlist_SelectedIndexChanged(object sender, System.EventArgs e)
{
Label1.Text = DropDownList1.SelectedItem.Text;
}
Note: SelectedIndexChanged event will fire only when you change the dropdown item.
Regards - J O H N -
|
|
|
|
|
yes I check at this lines.
|
|
|
|
|
No Go To My Pointer this function
|
|
|
|
|
Gagan Deep Garg wrote: No Go To My Pointer this function
what do you mean?
Regards - J O H N -
|
|
|
|
|
set the Debug pointer not go to debug pointer in this function.
|
|
|
|
|
I don't get exactly what you are saying?
Regards - J O H N -
|
|
|
|
|
Please add this item as follow :
dropdownlist1.items.add("abcd");
then write this code of selectedindexchanged event as follow:
int index=dropdownlist1.selectedindex();
// to confirm the desired index number pls write this code
Response.write(index.tostring());
if(index==0)
{
Response.Write("Asdf");
}
Ritesh Mogha
|
|
|
|
|
|
set AutoPostBack to true in the DropDownList
|
|
|
|
|
Hi...
I have created a text in datagride. the values in text which are in datagride has to be redirecte to new page.
krishna
-- modified at 5:38 Tuesday 30th October, 2007
|
|
|
|
|
use query string to solve ur problem.
Devjit Das
|
|
|
|
|
Thanx for ur response...
But how to use query string, i have tryed but it was not working can u pls send me some code to check...
Thanx in advance...
I need ur help
|
|
|
|
|
just tell me from where u want to click and redirect ur page from grid or button. if grid use grid_rowcommand and get ur text and redirect.
like this
Response.Redirect("abc.aspx?ID=" + ((TextBox)row
.FindControl("TextBox1")).Text);
will work.
Devjit Das.
|
|
|
|
|
I cant able to copy and past my code.....can u give ur email id plssss...
I need ur help
|
|
|
|
|
Response.Redirect("abc.aspx?ID=" + ((TextBox)row
.FindControl("TextBox1")).Text);
the abve code which u have given is not working...
the receiving(the page has to be redirect to this page) page i have given the command like..
lbl1.Text= Request.QueryString["txt1"];
krishna
|
|
|
|
|
????????????? wrote: I have created a text in datagride. the values in text which are in datagride has to be redirecte to new page.
text in Datagrid to redirect to a page? what do you mean by this?
Regards - J O H N -
|
|
|
|
|
text in Datagride means.... i have created a textbox in datagride, so that i can redirect that text message into the new page.....from there i will use conditions to get the output.
I need ur help
|
|
|
|
|
Are you using Response.Redirect to Redirect to new page?
Regards - J O H N -
|
|
|
|
|
yes iam using the same thing, its redirecting but values are not redirecting..
I need ur help
|
|
|
|
|
Are you passing the values as Query String to the next page?
Regards - J O H N -
|
|
|
|
|
You can use Request.QueryString..It will work.....
Rajendran
|
|
|
|
|
I have tryed but its not working, its working in normal condition, but i have created a table inside a datagride, so have redirect the text value to the new page..
I need ur help
|
|
|
|