hi i have a problem regarding to datagrid in aspdotnet.i
have a datagrid in my application.i have to place
add,edit,delete buttons or links what ever it may be.
now the problem is if i click on add button then the page
has to redirected to another form called "xyz.aspx" and if
i click on edit button the page has to redirected to
another form called "abc.aspx".i am phasing the problem
that if where ever i click on the datagrid the cursor goes
to gv1_SelectedIndexChanged event.please tell me the
solution about the code.
Answer Posted / vipal
For this grid have item bound property. in that you find
the control linkbutton used for add. And register script
for add button click event and call javascript function and
use window.location to redirect to the new page xyz.aspx.
protected void DataGrid_itemBound(Sender s,EventArgs e)
{
LinkButton LnkBtn = (LinkButton)DataGrid.item.FindControl
("LnkAdd");
LnkBtn.Attributes.Add("onclick","OpenNewPage();");
}
---in aspx page use script---
function OpenNewPage()
{
window.location = "xyz.aspx";
}
similarly find link button for edit and follow same process
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What do you understand by aggregate dependency?
What is the life cycle of web page?
What are Master Pages in ASP.NET? or What is a Master Page?
What does aspcompat="true" mean?
Which is an advantage of application service providers?
What is a url string?
What is the question mark in a url?
How to find last error which occurred?
Why mvc is better than asp.net? : Asp.Net MVC
What is a uri query?
What is the difference between web.config and machine.config in ASP.NET?
How do cookies work?
What are the asp.net list controls and difference between them?
What is a global postback url?
How do sessions work?