?
Solved

How to create a LinkButtonTester object in NUnitAsp

Posted on 2007-10-05
5
Medium Priority
?
257 Views
Last Modified: 2013-11-26
How do I create a New LinkButtonTester using NUnitAsp for a LinkButton that is nested inside a DataGrid which is also inside an update panel which is also inside a ContentPlaceHolder?  

I cannot find the correct name to use so that NUnitAsp can find it on my page.
0
Comment
Question by:misdevelopers
  • 3
  • 2
5 Comments
 
LVL 70

Expert Comment

by:Merete
ID: 20025232
Hi misdevelopers, well done
can this assist you as a starting point as I am no epert in this area really.
This guide contains a brief description of NUnitAsp and how to use it. It assumes that you're familiar with NUnit, ASP.NET, and unit testing
Quick start guide
http://nunitasp.sourceforge.net/quickstart.html
Overview
http://nunitasp.sourceforge.net/
Using NUnitASP to test DataGrid editing
http://www.cornetdesign.com/2005/07/using-nunitasp-to-test-datagrid.html

Good Luck
0
 

Author Comment

by:misdevelopers
ID: 20025306
Thanks!  Prior to posting my question here I had reviewed the sites you've mentioned.

In the examples, they give a name in the parameter for the name of the LinkButton, as follows:

LinkButtonTester updateLink = new LinkButtonTester("cmdUpdateReasonCode", editRow);

I create my asp datagrid control with an asp:ButtonColumn using the following code:

<asp:ButtonColumn CommandName="SelectClass" Text="Select Class"></asp:ButtonColumn>

There is no ID for this linkbutton that I can find to reference in the above parameter.  (SelectClass or Select Class doesn't work, I tried).
0
 
LVL 70

Accepted Solution

by:
Merete earned 1500 total points
ID: 20025360
I'm just using google okay as I said I have no expertise in this so its pot luck lol.

Simple Insert, Select, Edit, Update and Delete in Asp.Net GridView control
http://www.aspdotnetcodes.com/GridView_Insert_Edit_Update_Delete.aspx
0
 

Author Comment

by:misdevelopers
ID: 20025560
Well, that last link you found helped me solve the problem.  The problem was the way I was creating the linkbutton in the ASP.Net datagrid.

Solution:
Instead of:
     <asp:ButtonColumn CommandName="SelectClass" Text="Select Class"></asp:ButtonColumn>

You need to use:
     <asp:TemplateColumn>
           <ItemTemplate>
                <asp:LinkButton ID="ViewClasses" Text="View Classes" runat="server" CausesValidation="false" CommandName="ViewClasses"></asp:LinkButton>
            </ItemTemplate>
      </asp:TemplateColumn>

This gives the required Id to work with.

Thanks!
0
 
LVL 70

Expert Comment

by:Merete
ID: 20025605
oh my god  that's awsome for you and makes very happy.
Cool. Thank you
Best Wishes
Merete
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.
Six Sigma Control Plans

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question