Web Forms :: Open Link In New Tab Is Opening Blank Page

May 7, 2015

I have designed menu using <ul> and <li> tags and handled onserverclick event, where redirection code is written. This code works fine for normal click. But when I right click on the link and select "Open link in new tab", it opens blank page. So how can I handle this scenario.

 Following is the sample code,

<ul class="rounded-corners "> <li name="menuSample"><a onserverclick="lnk_clicked" runat="server" href="~/Sample.aspx" title="Sample">Sample</a></li>
</ul>
 
Server side code:

protected void lnk_clicked(object sender, EventArgs e)
{
strPage = (sender as System.Web.UI.HtmlControls.HtmlAnchor).Title.ToString();
Response.Redirect((sender as System.Web.UI.HtmlControls.HtmlAnchor).HRef);
}

View 1 Replies


Similar Messages:

AJAX :: Try To Open My Webservice In IE Browser Using Following Link To See The Javascript Proxy, It Return Blank Page?

Apr 11, 2010

I created a very simple webService using the VS2008 template. i am planning to use Ajax call for the webService.when i try to open my webservice in IE browser using following link to see the Javascript proxy, it return blank page.[URL]

View 3 Replies

Web Forms :: Get A Blank Screen When Opening Any Page In Browser?

Feb 7, 2011

any page that I open in my browser comes up blank.

I don't get any errors, it just comes up blank.

I also noticed that it seems to bypass forms authentication. For example, even though the page I open is blank, it is the actual page name that shows up in the browzer instead of the page that it usually redirects to for the forms authentication.

View 5 Replies

Web Forms :: How To Open In Blank Page

Sep 8, 2010

I have created master page in my application using site map and have some web forms. When I click a link from site map I would like to open in blank page like popup window. How can I do that ?

View 3 Replies

Web Forms :: Check Target Page Before Opening Link

Dec 20, 2010

Searched and couldn't find anything. I'm wrtiting an intranet application, and it creates links to see the original PO or Order for a given order number. Problem is that some of these orders were never put into the system electronically, so you get an error 400, no such page. Is there some way to programatically 'test' a link before sending the user to this error message?

View 2 Replies

Clicking Browser Back Button Is Opening A Link In The Previous Page?

Apr 22, 2010

I am using the below code

[Code]....

In the page there are two links. When i click the first link it opens a window in a new page. I do this by using the above code.

I am clicking the second link in the page and navigating to another page. Now i am clicking the browser back button. Supprisingly its opening the first link.

How clicking back button is opening the link in the page. I am using c# .net 2005.

View 1 Replies

Forms Data Controls :: Link In Gridview - Open New Page And Bring All Details?

Sep 4, 2010

i have the following gridview i would like the Vistidate column to be a link2) as you can see each patient can have multiple visit dates. when for example i click on 12/08/10 which is going to be a link i would like a new page to open and bring all the details from that visit into the various textboxes that i have such as DOB, telephone etc.

View 10 Replies

Forms Data Controls :: Opening A PDF File From A Gridview Link?

Jan 13, 2011

I have a Gridview of a database which displays the PDF files which I have uploaded onto the website.

I want to add a link/button to each record so that when I click it it opens the PDF file in Adobe Acrobat.

View 3 Replies

C# - Open Page In New Window When A Link Button Is Clicked

Sep 27, 2010

I was trying to open a new window when a link button is clicked.

<asp:LinkButton ID="lnkpackageinfo" CssClass="linkclass"
runat="Server"
OnClientClick="lnkpackageinfo_Click()">Compare Packages</asp:LinkButton>

I want the target page to be given in the code behind because in the target page i want to use querystring to hide few buttons and links. It is clear

protected void lnkpackageinfo_Click(object sender, EventArgs e)
{
long MerchantID = CommonHelper.GetLoggedInMerchant();
string querystringpackageinfo = ApplicationData.URL_MERCHANT_COMPANY_PACKAGE + "?MerchantCompanyPayment";
Response.Redirect(querystringpackageinfo, false);
}

View 3 Replies

Forms Data Controls :: Gridview Databound Link - Target In Blank?

Jan 11, 2011

I want to make a link in databound data which is stockQtt. How can I do that? and I want target is blank and the link page is AdjStock.aspx below is coding.

<asp:GridView ID="GridSql" runat="server" AllowPaging="True"
AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="itemId"
DataSourceID="StockSql" Width="980px"
<Columns>
<asp:BoundField DataField="itemId" HeaderText="Item ID" ReadOnly="True"
SortExpression="itemId" >
<ItemStyle Width="5%" />
</asp:BoundField>
<asp:BoundField DataField="categoryId" HeaderText="categoryId"
SortExpression="categoryId" Visible="false" >
</asp:BoundField>
<asp:BoundField DataField="catDesc" HeaderText="Category"
SortExpression="catDesc" >
<ItemStyle Width="13%" />
</asp:BoundField>
<asp:BoundField DataField="model" HeaderText="Model" SortExpression="model" >
<ItemStyle Width="13%"/>
</asp:BoundField>
<asp:BoundField DataField="itemDesc" HeaderText="Description" ...................................

View 4 Replies

C# - Opening New Tab Using A Link With Querystring Variable?

Dec 31, 2010

The problem I am having is that I would like to open a new tab via a link button or link on my page. I need to append a query string variable from the page onto the end of the reference, because it is passing a parameter to a report.

I've successfully passed the parameter and opened the report in the same tab using this code:

protected void lbSummary_OnClick(object sender, CommandEventArgs e)
{
Response.Redirect("http://myreportserverURL&rs:Command=Render&Year="+YearID);
}

And I've successfully opened the report in a new tab without passing the parameter with this code:

<a href="http://myreportserverURL" target="_blank" class="menu">Report Name</a>

I would prefer to do both. One important note is that opening a new window, instead of a new tab, is not what I need. I do understand that this is somewhat dependant on browser use, but for this project I can assume that users will be on IE8.

View 2 Replies

Open A File Share Link From Window.open Javascript?

Aug 2, 2010

I am trying to open a file share link from the window.open ... but its adding the http://localhost/vdir/ before the path can any one say what is the problem?

View 1 Replies

Web Forms :: Open Link With Aspx?

May 2, 2010

I have a Link in my Gridview and when i click it i want it to open in a page with certain "design".

I want when i click the link to take its ID and pass it over the handler.

Like for exaple clicking on a news Title and open the article to view the entire article.

View 7 Replies

Web Forms :: How To Open Link In New Tab In All Browsers

Oct 18, 2013

How to open link in a "New Tab" in all the browsers, after clicking on Image button ?

The code that i used opens link in new browser window, but i want it to open in new tab.

View 1 Replies

Web Forms :: How To Open Link (URL) In Other Window

May 7, 2015

I am using an asp:button to open a url link :

protected void redirectTo_OnClick(object sender, EventArgs e) {
Response.Redirect("http://www.google.com");
}

This link open itself in its own window , i want it to be opened in other window just link we do in html

< a href="google.com" target="_blank"></a>

How to do this in c# ?

View 1 Replies

Web Forms :: How To Open A New Window Using Link Button

Feb 9, 2010

I am trying to navigate it to another page using Link Button and in the .cs file, I am using Response.Redirect. But I want it to the open in a new window.

The reason why I cant use hyperlink is I cant use Command Arg and Command Name which I am using in the Link Button.

I tried the below Javascript, But it's coming as a pop up for the first time when it loads. I don't want it in that way also.

Is there a way like Hyperlink '_blank'.

public static void OpenNewWindow(string url, Page thispage)
{
string fullURL = "window.open('" + url + "', '_blank', 'fullscreen = no, status=yes,toolbar=yes,menubar=yes,location=yes,scrollbars=yes,resizable=yes,titlebar=yes' );";
ScriptManager.RegisterStartupScript(thispage, typeof(string), "OPEN_WINDOW", fullURL, true);
}
.cs
<asp:LinkButton ID="lbtn_photo" runat="server" Text="Upload Photo"
OnClick="Upload_Photo"></asp:LinkButton>
protected void Upload_Photo(object sender, EventArgs e)
{
Response.Redirect("UpPhoto.aspx?id=" + Request.QueryString["id"]);
}

View 8 Replies

Web Forms :: How To Open Link To Pdf File In New Tab Using HTML

Jun 1, 2010

I have an html page which contains link to open pdf file. however this link opens in adobe reader when i click on it. I have set target property to blank. but it doesnt work either. I want to open this pdf file in new tab in the same window.

View 6 Replies

Web Forms :: Open Excel File From Link?

Mar 1, 2011

I have a requirement where i need to open excel file from system using link

i build link from code <a href="path fo file">

but this does not work from aspx page

if i put same thing in seperate html page nd run it works fine

View 6 Replies

Web Forms :: Open A Ppt When Link Button Is Clicked?

May 18, 2010

I have a ppt in a folder Rocky and i am doing something like this :

this.btnSmartQuoteTutorialVideo.OnClientClick = "OpenMaximizedWindow('Tutorials/Paoli/PaoliSmartQuoteTraining.ppt'); return false;";

View 8 Replies

Web Forms :: Open Link In Masterpage Contentplaceholder?

May 19, 2010

I have a master page that contains a menu, the menu contains links to pages outside the website, how do get those links to open up in the main contentplaceholder of the master page? I tried setting the target to the ID of the contentplaceholder but that didnt work.

View 2 Replies

Web Forms :: Open A New Tab In Iframe Using A Link Button?

Nov 30, 2010

I have an iframe inside that there is a linkbutton if i click it should open a new tab in that browser,or Unblockable POPup's. I cant change it into other controls like Hyperlink or <a> tag, coz i am doing an DB updation in that linkbutton click event also passing values in query string.

View 7 Replies

Web Forms :: Open In A New Tab On Image Or Link Button

Aug 27, 2012

I want when any user right click on Image button or link button on my website at that time I want him to show open in a new tab.

The event has been created on Datalist_Itembound event and from their I am redirecting user to another window.

View 1 Replies

Web Forms :: When Click On Corresponding Link Must Open The Corresponding Closed Webpart?

Sep 9, 2010

I have Five Web part Zones in my page and each one have Gird control.

I have Five link buttons in same web page.

My requriemnt is when Any webpart is closed, when click on corresponding link must open the corrsponding closed webpart.

View 1 Replies

Web Forms :: How To Open/close The Panel By One Link Button

Dec 9, 2010

I am tring to open the panel with clicking linkbutton and to close the same panel using that link button .How can i write close and open in one event .

View 4 Replies

Forms Data Controls :: Open Link In New Tab In Gridview?

Mar 22, 2011

I am having one gridview in my asp form with one of the template field as imagebutton.

1. when i click on imagebutton the corresponding user profile opens in same tab....there is no option for open in new tab on right clickk..

open the user profilee in new tab.

View 16 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved