ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   SiteMap shows list of All Categories in this site.
Google
 
Categories  >>  Software  >>  Microsoft Related  >>  ASP.NET
 
 


 

 
 Visual Basic interview questions  Visual Basic Interview Questions
 C Sharp interview questions  C Sharp Interview Questions
 ASP.NET interview questions  ASP.NET Interview Questions
 VB.NET interview questions  VB.NET Interview Questions
 COM+ interview questions  COM+ Interview Questions
 ADO.NET interview questions  ADO.NET Interview Questions
 IIS interview questions  IIS Interview Questions
 MTS interview questions  MTS Interview Questions
 Crystal Reports interview questions  Crystal Reports Interview Questions
 BizTalk interview questions  BizTalk Interview Questions
 Dot Net interview questions  Dot Net Interview Questions
 Exchange Server interview questions  Exchange Server Interview Questions
 SharePoint interview questions  SharePoint Interview Questions
 Microsoft Related AllOther interview questions  Microsoft Related AllOther Interview Questions
Question
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.
 Question Submitted By :: Jyothisree
I also faced this Question!!     Rank Answer Posted By  
 
  Re: 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
# 1
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
Vipal
 
  Re: 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
# 2
Hey,

There is one more option do that.i.e. Take one 
Tepletecolumn,in that u should like this

	<asp:TemplateColumn HeaderText="Add/Edit/Delete">
					
	<ItemTemplate>
						
	<font face="verdan" size="2"><a href="Add.aspx" 
runat="server" ID="A1">Add</a>&nbsp;&nbsp;<a 
href="Edit.aspx" runat="server" 
ID="A2">Edit</a>&nbsp;&nbsp;<a href="Delete.aspx" 
runat="server" ID="A3">Delete</a>
						
	</font>
					
	</ItemTemplate>
				
	</asp:TemplateColumn>

from this you can do Process.......
 
Is This Answer Correct ?    0 Yes 0 No
Sasireddy
 
 
 
  Re: 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
# 3
Just i want to say you that remove server side code for 
page redirect when link click instead that write client 
side code.
 
Is This Answer Correct ?    0 Yes 0 No
Sudhir Kunnure
 
  Re: 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
# 4
You can use the ItemCommand event of the datagrid.
give each command button a 'CommandName' 
And 'CommandArgument' if required. CommandArgument you can 
assign at the time of ItemDataBound (or RowDataBound) event 
of the DataGrid. In the event handler method you can check 
for the command name and perform the required task.
 
Is This Answer Correct ?    1 Yes 0 No
Anant Anand Gupta
 

 
 
 
Other ASP.NET Interview Questions
 
  Question Asked @ Answers
 
What are different ASP.NET Web Forms with the technology different from though ASP (1.0-3.0)?  1
How ASP and ASP.NET page works.  1
we can able to display a MessageBox in asp .net without using any script langages? ABC5
if u r projet consist of 4 people means how can u manage the file Mind-Tree8
Describe the difference between a Thread and a Process?  4
What is advantage and disadvantage of viewstate  2
Difference between .NET components and COM components? Microsoft1
What are the disadvantages of view state / what are the benefits?  2
Can you explain what inheritance is and an example of when you might use it?  1
When web.config is called ? Keane-India-Ltd2
What property must you set, and what method must you call in your code, in order to bind the data from some data source to the Repeater control?  3
Difference between dynamic query and static query ? DELL1
What are the two properties that are common in every validation control?  4
which method marks a config file section for encryption?  1
What is Partial in ASP.NET 2.0? Fulcrum-Logic2
Describe the role of inetinfo.exe, aspnet_isapi.dll andaspnet_wp.exe in the page loading process.  1
What are the various authentication mechanisms in ASP.NET ? Digital-GlobalSoft1
where should write the connection string Show that it will apply whole pages in the website Symco5
Does C# support static class?Is Static class be inherited by any class?  2
code for inserting images into gridview colomns from database HP3
 
For more ASP.NET Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com