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

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Hyperlink navigateurl property in datalist

Posted By:      Posted Date: September 10, 2010    Points: 0   Category :ASP.Net
Hi All I have a hyperlink control in a datalist and i set the navigateurl property in the codebehind based on a service name label. Like this... Protected Sub dlServices_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataListItemEventArgs) Handles dlServices.ItemDataBound        If e.Item.ItemType = ListItemType.Item Then            If TryCast(e.Item.FindControl("ServiceNameLabel"), Label).Text = "1" Then                TryCast(e.Item.FindControl("hlServiceUrl"), HyperLink).NavigateUrl = "~/1.aspx?user=" & Request.QueryString("user")            ElseIf TryCast(e.Item.FindControl("ServiceNameLabel"), Label).Text = "2" Then                TryCast(e.Item.FindControl("hlServiceUrl"), HyperLink).NavigateUrl = "~/2.aspx?user=" & Request.QueryString("user")            End If        End If    End Sub The problem is that as the datalist is re

View Complete Post

More Related Resource Links

Passing Multiple Parameters in NavigateURL Property of Hyperlink

In ASP.NET 3.5, is this the only way to pass Multiple Parameters in NavigateURL Property of Hyperlink ? What about using the HyperlinkField?<asp:TemplateField HeaderText="Form Name">    <ItemTemplate>        <asp:HyperLink ID="HyperLink2" runat="server"         NavigateUrl='<%# "~/Application/" + Eval("FormType") + ".aspx?FormID=" + Eval("FormID") %>'         Text='<%# Eval("FormName") %>'>                </asp:HyperLink>     </ItemTemplate></asp:TemplateField>

hiding hyperlink in url when its navigateurl is null

Hi Friends, I have a hyperlink control on my datalist. The navigate url property is bound to a field called "AttachFile" in my datatable. Is there a way I can make the hyperlink control invisible if the field it's bound to is null or blank? Thanks in Advance, Sepid 

Using CheckBox in DataList to set checked property

  I have a field called receive e-mail, field char (1) = "Y" (Yes) out "N" (No). I am using the DataList Control CheckBox inside when you enter Edit mode code EditTemplate am placing the following code:<Asp: DataList ID = "DataList1" runat = "server ".... " ye="" closure_uid_uriylf="527"><EditItemTemplate><Asp: CheckBox ... '/> " ye="Checked='' />" closure_uid_uriylf="529">Checked ='<%# Eval ("CHR_OPTIN_SMS ")==" S"? True: false%> '/> " ye="" closure_uid_uriylf="530" mce_style="BACKGROUND-COLOR: #fff"></ EditItemTemplate>.... " ye="" closure_uid_uriylf="532" mce_style="BACKGROUND-COLOR: #fff"></ Asp: DataList>When I run the program with any records he did not show marked and should be checked when the database is "S" in the field CHR_OPTIN_SMS.Could someone help me? if the above code is correct, if not, what should I do to solve this problem.

hyperlink in DataList


I am wishing to create hyperlink in below line

<asp:Label ID="urlLabel" runat="server" Text='<%# Eval("url") %>'>Click Here</asp:Label>

I have stored my url in database field name "url". I am wishing to use 'url' database field where url is sotred as hyperlink url. Please look at the code given below:

    <asp:DataList ID="DataList1" runat="server" DataSourceID="SqlDataSource1" 

<b> <asp:Label ID="titleLabel" runat="server" Text='<%# Eval("title") %>' /> </b>
<br />
<asp:Label ID="descriptionLabel" runat="server" Text='<%# Eval("description") %>' />
<asp:Label ID="urlLabel" runat="server" Text='<%# Eval("url") %>'>Click Here</asp:Label>
<br /> <br /> </ItemTemplate> </asp:DataList>

Help me please!

How set Name property for Hyperlink


Hello. How i can set Name property for Hyperlink by code.

I try

Hyperlink headerHl = new Hyperlink(new Run(templateElementViewModel.Header), textPointer)


	Name = templateElementViewModel.HeaderName,

	Background = new SolidColorBrush(Colors.LightGray)


but function FlowDocument.FindName(templateElementViewModel.HeaderName) return null, and xaml for document contein definition for  headerHl, where Name property undefin.

Sorry for my bad English.

Passing multiple parameter in NavigateUrl (hyperlink) in GridView




Have created a gridview with a hyperlink column (in template)  in it.

I need to pass 3 or 4 values to the web form by clicking hyperlink column in gridview.


I have managed to pass a single value to web form.



<asp:HyperLink Runat="server" ID="hlDividents" NavigateUrl='<%# Eval("Dividents", "TreatyRuleDetail.aspx?Rate={0}") %>' Text='<%# Eval("Dividents") %>

WPF / Silverlight tutorial: Visibility property and binding

Visibility property is a very powerful and yet often overlooked property available in both WPF and Silverlight. It enables you to set Visibility of certain UIElement objects to different states like: Visible, Collapsed and Hidden (not supported by Silverlight). This tutorial shows you how to use it and how to bind to Visibility property

abstract away the source of the connection string using a class with a static property.

ASP.NET provides a configuration system we can use to keep our applications flexible at runtime. In this article we will examine some tips and best practices for using the configuration system for the best results.

The element of a web.config file is a place to store connection strings, server names, file paths, and other miscellaneous settings needed by an application to perform work. The items inside appSettings are items that need to be configurable depending upon the environment, for instance, any database connection strings will change as you move your application from a testing and staging server into production.

Let's abstract away the source of the connection string using a class with a static property.

Get pixel format, raw format, property id list and property items image in VB.net - C#.net.

n this simple article you will learn that how we can get pixel format, raw format, property id list and property items image in VB and C#.net.

Get Pixel Format:

Image consists of pixels to get the format of the pixel we have a property named pixel format. This property returns an enumeration of pixel format. This enumeration tells the pixel format.

To demonstrate make a window application. Drag one button and a picture box on form.

Now write the following code on Button click event:

Jscript error: Object does not support property or method


 Hi, i have little knowledge on javascript but i need to use this code get from somewhere for a jquery to work.

I face this "Jscript runtime error: Object does not support property or method" whenever im trying to run this page.

In my experience, im get this error msg 9 out of 10 times i use javascript in my system.

Im using Microsoft Visual web developer 2008, i wonder if this is related to my problem, i not sure there is anything i need to add as reference or update anything.

But anyway, in short, i just couldn't use javascript code when using this development tool because of this sort of error.

Anyway, it happen that last time i tried use the same type of jquery code in another project and it seems to work well without an error.

But now when im try to use it again in this recent project i created, it come out with this error and i have no idea how to solve it even look through google and this forum.

It doesn't really seems like its the code problem itself although im not sure, because any javascript code just couldn't work.

So below is my code that i need to use.

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" ></script>
<script type="text/javascript" src=&quo

datalist image slide show problem


hi friends

i am binding  images dynamically(back end)for a datalist .iam applying a slideshow for it .I am getting a problem to apply slideshow for dyanmically binded images.If the define in a div statically it working perfectly

for example pls go through my code below:

<script type="text/javascript">
$(document).ready(function() {
        fx: 'scrollLeft' // choose your transition type, ex: fade, scrollUp, shuffle, etc...

<div class="slideshow">
        <img src="images/30_dummy.jpg" width="200" height="200" />
        <img src="images/aquarius.gif" width="200" height="200" />
        <img src="images/star.gif" width="200" height="200" />
        <img src="images/the-proud-indian-flag-1.jpg" width="200" height="200" />

I above code works perfectly and the slide show e

Is it possible to populate property choices from a database?


I'm creating my first server control, and have it working where I can set up an enum and the user can set a property's choices,  based off of that enum.  But I'd like it to pull records from a database and populate the list of choices for the property from a database.  This would allow me to add a new "Host System" to the database, and the other designers wouldn't have to get a new copy of the dll.



Custom Server Control Property not maintaining state


I have created a server control consisting of a TextArea and a div under it.  My goal is to create my own asp:TextArea type control.  the div is for a Character count of the text area and seems to work ok but i added a CharacterCountVisible property to the control that is always returning true.  See Proptery definition below


<Bindable(False), Category("Appearance"), DefaultValue("True"), Localizable(True)> Property CharacterCountVisible() As Boolean
        Return _CountBoxVisible
    End Get
    Set(ByVal value As Boolean)
        _CountBoxVisible = value
    End Set
End Property

Note the _CountBoxVisible variable is define inside the class as :

Dim _CountBoxVisible as Boolean = True

What I am trying to do is give the user/coder the option to show/utilize the char count feature.  Can make it disappear with textarea1.CharacterCountVisible = False but setting it to true will not make it display.


What am i missing





Category attribute of user control property does not work correctly in categories tab.



I have a User Control (ascx) and a property which a want to display in my categories tab in Visual Studio in the category named "Styles".

[Category("Styles"), DefaultValue(""), Description("The value for formating something.")]
public String MyFormatProperty
set { /* the code for set */; }
get { /* the code for get */; }

And here is the problem: Actually I do not need a get, because I only have to set the property (write only property). But when I omit the get, the property is displayed in the "Misc" category in the categories tab in Visual Studio. Only when I code the get as well, then the property is displayed correctly in the "Styles" category in the categories tab in Visual Studio.

Does anybody know why? How can I display the category correctly only with set?

Thanks, S.

Restrict Hyperlink


Hello All Experts,

I have made one matrix report, in which i have taken one column group named as "Branch".
It will display dynamically all the branches. Now in that column group i have added two sub column
as "PO", "SO". In column "PO" i have given link of anther report with the paramtere also.

Now there is a hyperlink in PO column which is display for all the branches, i want that the hyperlink should be there for only branch name "AHD", for other branches there should not be any hyperlink to go another report.

Is this possible? if yes then how can we do this?


Need to know (the value of a) clientside property on the serverside


I need to know on the serverside, if a RadioButton has been disabled (by javascript) on the clientside.


The (serverside) Enabled property is not the same as the (clientside) disabled property. Using MyRadioButton.Attributes("disabled") doesn't do the trick either.


Any clue?

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