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
If I have more than one version of one assemblies, then how will I use old version (how/where to specify version number?) In my application?
what are configuration files?
What are the types of authentication in asp.net?
How many types of sessions in asp.net?
What is use of Master Page in ASP.NET web pages?
Explain about solution explorer window?
How many ways are there to maintain a state in .net? What is view state?
How many types of triggers are there in update panel?
What is caching? What are different ways of caching in asp.net?
What is asp.net response object?
How do you open a page in a new window?
Why is this service branded with windows livetm?
What is AutoEventWireup attribute for ?
How can we register exception filter globally?
What is the syntax for datagrid and specifying columns?