Help On Events firing to bind data

Posted by Vijayar under C# on 7/29/2011 | Points: 10 | Views : 866 | Status : [Member] | Replies : 4
Hi
I have placed a drop down by the side of it i placed a go button by side of drop down ,based on value selected in drop down i am binding values to a grid view .
Here i am writing code in g0_click event,but the event is not getting fired .Is this the wrong way.Suggest me the correct way to bind data to a gridview on selecting value in dropdown and by clicking on button

<asp:DropDownList ID="ddluiversitytype" runat="server" CssClass="txtbox" AppendDataBoundItems="True" OnSelectedIndexChanged="ddluiversitytype_SelectedIndexChanged">
<asp:ListItem Value="0">--Select--</asp:ListItem>

</asp:DropDownList>
<asp:ImageButton ID="go" runat="server" ImageUrl="~/prosper_images/save.png" OnClick="go_Click" />

protected void go_Click(object sender, ImageClickEventArgs e)
{ }

vijaya


Responses

Posted by: Emil on: 7/29/2011 [Member] Starter | Points: 25

Up
0
Down
Add propery AutoPostBack to "true" of dropdownlist and onchangeof dropdown list grid will be binded

Vijayar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vijayar on: 7/29/2011 [Member] Starter | Points: 25

Up
0
Down
i want to bind data by clicking on go button

vijaya

Vijayar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Hemanthlaxmi on: 7/29/2011 [Member] Starter | Points: 25

Up
0
Down
Set AutoPostback="false" and Try to bind the Gridbased on the Value selected .
Frame the select Query like this [code]
string strQuery="select * from EMP where eid like '%"+ddl.selectedValue+"%';[/code]

If this helps you .
Please "Mark as Answer"

Vijayar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: A4u_6178 on: 7/29/2011 [Member] Starter | Points: 25

Up
0
Down
Hi Vijayar,

Pls refer the posts in link below.. u get the idea ..
http://www.dotnetfunda.com/forums/thread5555-help-on-grid-view-filtering.aspx


Thanks & Regards,

Vijayar, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response