Subscribe to Subscribers

Online Members

Shahbaz Ahmed
More...

Forums » .NET » .NET »

I wish to automatically fire hyperlink event so that the page is open on particular condit


Posted Date: 20 Jul 2012      Posted By:: Vinod     Member Level: Silver    Member Rank: 1366     Points: 4   Responses: 4



I have a gridview control in that one hyperlink column,
below is the code in grdvwJobsInProgress_RowDataBound event

HyperLink hypjobid = (HyperLink)e.Row.FindControl("hprjob");
hypjobid.NavigateUrl = "../PopupPage/Information.aspx?Para=7&RoleId=" + RoleId + "&JobId=" + (DataBinder.Eval(e.Row.DataItem, "jobId")).ToString();

I wish to automatically fire hyperlink event so that the page is open on particular condition.





Responses

#681256    Author: Mahesh Durgam      Member Level: Gold      Member Rank: 137     Date: 20/Jul/2012   Rating: 2 out of 52 out of 5     Points: 3

Hi,

You have to bind the event on rowdatabound event in order to fire the hyperlink on specific condition

Check the below modified code of yours



HyperLink hypjobid = (HyperLink)e.Row.FindControl("hprjob");
if(condition)
{
hypjobid.NavigateUrl = "../PopupPage/Information.aspx?Para=7&RoleId=" + RoleId + "&JobId=" + (DataBinder.Eval(e.Row.DataItem, "jobId")).ToString();
}
else
hypjobid.NavigateUrl = "";



Thanks,
Mahesh


 
#681261    Author: Vinod      Member Level: Silver      Member Rank: 1366     Date: 20/Jul/2012   Rating: 2 out of 52 out of 5     Points: 1

Thanks for response mahesh
But my requirment is that the hyperlink event fire automatically after its bind for certain condition without click.


 
#681262    Author: jogesh      Member Level: Gold      Member Rank: 229     Date: 20/Jul/2012   Rating: 2 out of 52 out of 5     Points: 2

Try this...

HyperLink hypjobid = (HyperLink)e.Row.FindControl("hprjob");
if(condition)
{
hypjobid.NavigateUrl = "../PopupPage/Information.aspx?Para=7&RoleId=" + RoleId + "&JobId=" + (DataBinder.Eval(e.Row.DataItem, "jobId")).ToString();
Response.Redirect(hypjobid.NavigateUrl);
}





 
#681264    Author: Vinod      Member Level: Silver      Member Rank: 1366     Date: 20/Jul/2012   Rating: 2 out of 52 out of 5     Points: 1

Hi I know this trick
but i have to open the pop-up page without closing the parent window, and i m opening the pop up window using fancymodalbox.

is this working ?


 
Post Reply
You must Sign In to post a response.

Next : How to write Storedprocedures in Ms-Access
Previous : To open an excel sheet using windows forms
Return to Discussion Forum
Post New Message
Category:

Related Messages

Active Members
TodayLast 7 Daysmore...

Awards & Gifts
Talk to Webmaster Tony John
Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India
2005 - 2013 All Rights Reserved.
.NET and other trademarks mentioned in this site belong to Microsoft and other respective trademark owners.
Articles, tutorials and all other content offered here is for educational purpose only.
We are not associated with Microsoft or its partners.