Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is http protocol and how it works?

971


In Code-Behind class which kind of code (server or client) is found ?

1001


What is the mvc framework?

951


What is data grid view in asp.net?

904


What does ascx stand for?

893


How do u deploy ur project?

2634


Explain about Multi-Language integration?

964


What is actually returned from server to the browser when a browser requests an .aspx file and the file is displayed?

951


What are the different types of events are occured when a client requests an ASP.NET page from IIS server?

1056


Why should i prefer JSP over asp.net or any other web development language..??

1937


What are the different types of cookies in asp.net?

974


Explain the steps needed to be performed in order to create an animation in xaml?

963


Define xmlreader class.

957


Explain the different types of directives in .net?

881


What is another word for redirect?

900