.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Imran Ghani
Post New Web Links

a href in asp:ListItem

Posted By:      Posted Date: September 06, 2010    Points: 0   Category :ASP.Net
I want to have an a href within a  asp:ListItem I tried it the normal way but it's not working.. it's show the ahref code when displaying the asp.net page on the browser what can i do?

View Complete Post

More Related Resource Links

Javascript funtion in the href property does not accepted


I try to add the following code in a sharepoint 2010 web page

<a href="javascript:function();"> This is a test</a>

but each time I save it, the line disappear. What is wrong with the code??



ListItem Dynamic DropDownList based on custom list entries.

I utilized the following solution to get the drop down list on the page and populate it dynamically, but it doesn't save the selected value back to the SPListItem object. Does anyone have a better solution possibly for this? http://geekswithblogs.net/SoYouKnow/archive/2010/01/21/sharepoint-populating-drop-down-list-field-with-data-from-different.aspx

Issue with in Repeater

Hi -I have the following<%#IIf(IsDBNull(DataBinder.Eval(Container.DataItem, "Website")) OrElse String.IsNullOrEmpty(DataBinder.Eval(Container.DataItem, "Website")), "", DataBinder.Eval(Container.DataItem, "Website") & "<br />")%>I want to add <a href......if the records is not empty.Where do I add that?- Thanks

Get attachment data to a Field in the ListItem

Hi All, I have a list with Attachments,Title and Description fields in the List. And i have a requirement that when an attachment is added to the List(while adding a new item), the attachment data sholud be entered into the Description Column and save the item into the List. Can i do this functionality without using custom webpart..... Please suggest me the ideas.....  

How to make a connection between a word in the cell (href)? and a rule of the same or another table

 HelloHow to make a connection between a word in the cell (href)? and a rule of the same or another table with sql. Is there also finished editors?

Href and HrefAttribute

What is the difference between @Href and HrefAttribute?

Generic ListItem Field Update function?

Just wondering: is there a built-in utility function to set field value for any field type? E.g., SetFieldValue(SPListItem, object value1, optinal object value2, optional object values) You know so boring to update fields considering so many different types. I bet MS guys did one somewhere!? thanks,

setting a href value using javascript and server value from database

Hi Guys,I've been trying to set the href value of an anchor tag using it to do a javascript function, but also want it to have a database value... the whole page is to be called using the jquery .load method which is working fine... just want to get the link to work...here is the code so far for the whole page...<form id="form1" runat="server"> <div id="ajaxeditorspicks"> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:db639_55atcConnectionString %>" SelectCommand="SELECT TOP 3 * FROM [News] WHERE ([EditorsChoice] = @EditorsChoice) ORDER BY [ID] DESC"> <SelectParameters> <asp:Parameter DefaultValue="True" Name="EditorsChoice" Type="Boolean" /> </SelectParameters> </asp:SqlDataSource> <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1"> <ItemTemplate> <li><a href="#"> <asp:Image ID="image1" runat="server" ImageUrl='<%# Bind("imageurl") %>' AlternateText='<%# Bind("Title") %>' />

href - help with opening a pdf

Hi all, I am able to read the textbox value but the pdf will not open for me, I just get a blank IE page. I can open it from IE if I place the location in the address bar or directly point it "href = "location". Here is what I have:  <script type="text/javascript">    function readTextbox() {        var myTextField = document.getElementById('<%= Textbox1.ClientID %>');        if (myTextField.value != "")            alert("You entered: " + myTextField.value)        else            alert("Would you please enter some text?")    }     </script>                                                   <a href="" onclick='readTextbox();' target="_blank">         <img src="images/PDF_icon.jpg" dir="ltr"

Skip link in databinding on an empty image

Hello folks, I have a problem with databinding an <a href> link when there's no image available for the link. My intention is to display a link with <a href=...> when there is an image available and skip the <a href...> if there is no image available but just display the image. i've tried the following but no result:   <%# DataBinder.Eval(Container.DataItem,"adImage") == "noimage.gif" ? <a href='/displayad.aspx?adc=<%# DataBinder.Eval(Container.DataItem,"id")%>' title="(c)" ><img src='DataBinder.Eval(Container,"adImage") /></a> : <img src='DataBinder.Eval(Container,"adImage") />  %s    

Windows 7 window.open() and - target issue



In Windows 7 when I use window.open(url, "_MyWindow") a new browser window opens every time I click.

Expected behaviour is - URL is replaced in the browser window with the same target attribute (_MyWindow) if it's already open.

Any suggestion/workaround is greatly appreciated.

All works fine in any other OS/IE config, even on XP/IE8.




same issue appears using <a href=http://www.microsoft.com target="_MyWindow">Open link</a>

how to get listitem value in aspx


I want to get the value of listitem of the radio button when i am changing the selection. I need it in javascript.

function rblSelectSearch_click()


i have added in .cs page


"onclick", "return rblSelectSearch_click();");

can you give me the code or example to write inside rblSelectSearch_click in javascript.

A Href removing space when passing a string in a email

In an email action I'm building a string using an <A href.  I'm working with a list called Document Sets and also a column called Document Set.  I'm passing to a page the current document set in order to filter a web part. 

Here is the example

<A href="http://test.net/sites/r3bs/DocSetPAHO/Site%20Pages/dynamic.aspx?DocumentSet=<%Document Set%>">Click here to review the items.</A>

The problem is that when the document set column data contains a space (such as Company Overview), the email removes the space between Company and Overview (as seen below).  If I add the Document Set column to the email directly it displays fine with the space 

[%Document Sets:Document Set%]


I've tried storing the value to a workflow variable but it still removes the space in the actual email.

How to get ItemId of ListItem rendered in ListViewByQuery control?


Hello All,

I have displayed a list item from a list in a ListViewByQuery control with the help of SPQuery in a custom Web Part like this:

SPQuery myQuery = new SPQuery(List.DefaultView);
myQuery.RowLimit = 1;
myQuery.ViewFields =
                                "<FieldRef Name='" + SPBuiltInFieldId.ID + "'/>" +
                                "<FieldRef Name='" + SPBuiltInFieldId.DocIcon + "'/>" +
                                "<FieldRef Name='" + SPBuiltInFieldId.LinkFilenameNoMenu + "'/>";

Hiding radio button ListItem element


Hi all,

I have an ASP.NET page written in C#:

<asp:RadioButtonList ID="radioButtonListSelection" runat="server" AutoPostBack="True"
                            CssClass="label" OnSelectedIndexChanged="radioButtonListSelection_SelectedIndexChanged"
                            RepeatLayout="Flow" RepeatDirection="Horizontal">
                            <asp:ListItem Value="0"   >All Current</asp:ListItem>
                            <asp:ListItem Value="1" Selected="True">Pre Selected</asp:ListItem>
                            <asp:ListItem Value="2" >From Date</asp:ListItem>

I want to be able to hide some of the listitems, however there is no option to do this as I am only able to disable them.

I have read somewhere on the web that you can do this but the code is in VB :(

After after a solution in C#.






Button in Ribbon.ListItem.New doesn't appear when list is added via a webpart


I have added a button to a project task list (id = 150).
Everything works fine when I directly use the list. But when I add the list via a webpart to the site page my new button is not available. It's exactly the same ribbon as in the list view but my new button is not visible. Any suggestions?

  Title="Ribbon Customization for a Content Type">
    <CommandUIDefinition Location="Ribbon.ListItem.New.Controls._children">

How To:Renaming ListItem on Sharepoint Foundation DocumentLibrary ?



Can anyone guide me how to Rename the ListItem (Field"Name") of Sharepoint Foundation DocumentLibrary List as per my req.

Here am using Treeview which am binding the records also to my TreevIew Herachailly and wanna make to rename with a Contextmenu(3 rd Party) with option called "Rename"


Thanks in Advance !!!





ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend