ASP.NET link to open image in new page - html

I have these two hyperlinks below. The first one opens the actual image on the current page.   The second one creates a link called Image2, but when I click on it, the image on that new page does not show up. I would really like the second one to open the image in a new page when the link is clicked on.
<asp:HyperLink id="id1" runat="server" target="_blank" ImageUrl='<%#"data:Image/jpeg;base64," + Convert.ToBase64String((byte[])Eval("ByteArrayFromDB")) %>' >Image1</asp:HyperLink>
<asp:HyperLink id="id2" runat="server" target="_blank" NavigateUrl='<%# "data:Image/jpeg;base64," + Convert.ToBase64String((byte[])Eval("ByteArrayFromDB")) %>'>Image2</asp:HyperLink>

Related

a href is not working after postback in updatepanel

I have a hyperlink in updatepanel and when I update the updatepanel then hyperlink is not clickable or not sending to the other page. But if I refresh the page hyperlink is working.
My hyperlink in updatepanel:
<asp:UpdatePanel ID="updatepanel" runat="server" UpdateMode="Conditional">
<ContentTemplate>
`Cart`
</ContentTemplate>
</asp:UpdatePanel>
<asp:Button ID="update" runat="server" OnClick="update_Click" Text="Update"></aspButton>
I have used button for update and button is outside of updatepanel:
protected void update_Click(object sender, EventArgs e)
{
updatepanel.update();
}
When i click on the update button than hyperlink is dead. Not sending to the destination page and seems update process is working at the same time.
I just want to learn how can I make hyperlink alive again.
SOLUTION:
There is nothing wrong with the code. Problem was the imported jquery library. Overriding all hyperlinks in my example. That is why i have faced with this problem. I have deleted the code. I hope it helps.

How can I add normal text in front of a hyper link on my ascx page

I am wanting to add normal text in front of a hyper link text.
I am adding my hyper link as shown in the following code
how can i add a "Go To" in front of the Text = "PreRegistration Work Queues"?
<td>
<asp:HyperLink ID="hyperlink2"
NavigateUrl="../WorkQueues.aspx"
Text= "Pre-Registration Work Queues"
Target="_new"
runat="server" />
</td>
You can either just add the text there, or add an ASP Label.
<asp:Label id="GoToLabel" Text="Go To" runat="server"/>

How to redirect to a specific section on an aspx page but from a different aspx page

I have created these links using asp: linkbutton, like this
<li id="lhome" runat="server" class="active"><asp:LinkButton ID="btnhome" runat="server" OnClick="btnhome_Click" href="#home" PostBackUrl="~/Index.aspx">Home</asp:LinkButton></li>
<li id="lservice" runat="server"><asp:LinkButton ID="btnservice" runat="server" href="#works" OnClick="btnservice_Click" PostBackUrl="~/Index.aspx">Services</asp:LinkButton></li>
<li runat="server" id="llogin"><asp:LinkButton runat="server" ID="btnlogin" OnClick="btnlogin_Click" PostBackUrl="~/Login.aspx">Login</asp:LinkButton></li>
My first page is Index.aspx which consists of home, about, services and other sections on a single page I can go to any of these sections directly from the same page. But if I am on the Login.aspx then on clicking these links just redirects me to the Index.aspx but not to the specific section. I tried almost everything but it didn't help.
This is my Index.aspx page:
I tried using this and when clicked on Home on Login.aspx
<li>About</li>
got this result:
the whole design got disturbed.
Please help how I can redirect to Services or About or other sections on Index.aspx from Login.aspx or other pages with the same header. I have created this navbar using asp.net UserControls and used it on both the pages.
I can't make my question more specific.
Please help!

new document dialog showing master page header images

I have a SharePoint team site and I made some changes in master page as below:
Moved top menu links and search box below page heading
In place of top links I placed an image called image1 and in place of search box I placed another image called image2
Replacing SharePoint logo with my own logo and increasing its size
I did all this using DIV/CSS. Now I am no designer, not even close. So I had to do a lot of trial and error before every thing looked ok except this one issue which now I am facing and i.e. when you click on "new document" link which opens a dialog box where you can upload document, that window is also showing those logos (which I mentioned in point 2 above)
How can I get rid of that? I was thinking that if somehow I can find out if the dialog is open then I can hide those images using CSS/Jquery?
Here's partial code to given you and understanding where I have wrote code. My divs are named "mydiv" and "mydiv2" while rest of the code is SharePoint's default:
<div id="WebPartAdderUpdatePanelContainer">
<asp:UpdatePanel
ID="WebPartAdderUpdatePanel"
UpdateMode="Conditional"
ChildrenAsTriggers="false"
runat="server">
<ContentTemplate>
<WebPartPages:WebPartAdder ID="WebPartAdder" runat="server" />
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="WebPartAdder" />
</Triggers>
</asp:UpdatePanel>
</div>
</SharePoint:AjaxDelta>
</div>
</div>
<div id="s4-workspace" class="ms-core-overlay">
<div id="mydiv" style="float:left;border:thin;border-style:none;width:210px;position:absolute; padding-top:20px;padding-bottom:0px;padding-left:200px;z-index:1;">
<img src="/images/image1.jpg" width="65%" height="65%"></div>
<div id="mydiv2" style="border: thin none currentColor; width: 250px; right:600px;position:absolute; padding-top:20px; padding-bottom:10px;float: right;z-index:1;">
<img src="/images/image2.jpg" width="800" height="56">
</div>
<div id="s4-bodyContainer">
<div id="s4-titlerow"
class="ms-dialogHidden s4-titlerowhidetitle">
<div id="titleAreaBox"
class="ms-noList ms-table ms-core-tableNoSpace">
<div id="titleAreaRow"
class="ms-tableRow">
Fixed by using CSS class ms-dialogHidden as mentioned here:
https://sharepoint.stackexchange.com/questions/200195/new-document-dialog-showing-master-page-header-images/200197#200197

Why is this hyperlink taking the whole table cell and not just on the text?

Facts:
I'm working under Visual Studio .NET 2008
I'm using Cufon-yui.js as a font replacement tool.
The link is inside of a Table <td> (as it handle much more info)
The command I use is:
<asp:HyperLink ID="thisistheID" runat="server" NavigateUrl="#">
<h3 style="width:250px;">Title of the Link</h3>
</asp:HyperLink>
In Firefox and IE, I'd like to mouse over the text and have the link there, solely. If I mouse over the whole cell (of the table) the link is available and appears there even tho I don't have letters there.
How can I have this link to work just where the letters are?
I hope I asked this question the appropriate way.
What happens if you turn it inside-out?
<h3 style="width:250px;">
<asp:HyperLink ID="thisistheID" runat="server" NavigateUrl="#">
Title of the Link
</asp:HyperLink>
</h3>
I think the problem is that you are making the h3 tag a link. Two ways to fix it if this is the case....
a. Style the asp:HyperLink and don't specify the width (no need for h3 tag unless you are doing some javascript stuff for it).
<asp:HyperLink ID="HyperLink1" runat="server"
Font-Bold="True"
Font-Size="Large"
text="Title of the Link"
NavigateUrl="default.aspx" ></asp:HyperLink>
b. Use plain old html mark up inside the h3 tag if you don't need to access the control server side:
<h3 style="font-size: larger">
Title of the Link
</h3>