Results 1 to 4 of 4

Thread: Single quote precision parameter consider as String

  1. #1
    Join Date
    Apr 2009
    Posts
    55

    Single quote precision parameter consider as String

    Hello friends,
    I want to navigate my URL but there is problem with the single quote and double quote URL.

    <asp:hyperlink navigateURL='file.aspx?id=<%=session("id")%>' runat=server>Link Text</asp:hyperlink>

    in the above URL parameter i want to pass parameter in the single quote and this is because the Double quoted text does not work properly as it is problem in the .NET, but the problem is that the parameters mentioned in the single quoted parameter considers as String and that does not deliver the appropriate goal.

    Thanks

  2. #2
    Join Date
    Oct 2008
    Posts
    167

    Re: Single quote precision parameter consider as String

    I use hyperlink column fine with embedded quotes with csharp like so:

    <asp:HyperLink id=HyperLink1
    runat="server"
    Font-Size="Smaller"
    ForeColor="#0000CC"
    Font-Names="verdana"
    NavigateUrl='<%# "?categoryid=" + DataBinder.Eval(Container.DataItem,"report_category_id") + "&amp;office=" + Request.QueryString["office"] %>'>
    <%# DataBinder.Eval(Container.DataItem,"report_category_name") %>
    </asp:HyperLink>

    So, change the plus signs to ampersands (and the pound sign out?) if you're using VB.

  3. #3
    Join Date
    Dec 2008
    Posts
    183

    Re: Single quote precision parameter consider as String

    I dont think you need an '=' again in <%=session("id")%>.
    also you can put a break point always and check if the value is there for id.set the navigate url parameter in your codebehind. Code islands should be avoided if at all possible.

  4. #4
    Join Date
    Feb 2006
    Posts
    185

    Re: Single quote precision parameter consider as String

    Generally the proper way of setting things like that is in the code behind.However, if for whatever reason you want to do it this way, it would look more like:
    NavigateUrl="~/test2.aspx?ID=<%# Bind("Id") %>" inside the element that you are setting that attribute on.

Similar Threads

  1. Need help to get single quote in every cell of Excel
    By Hache hi in forum MS Office Support
    Replies: 2
    Last Post: 23-02-2012, 12:17 PM
  2. How to get rid of single quote in Microsoft Excel sheet
    By Wisaal in forum MS Office Support
    Replies: 2
    Last Post: 10-02-2012, 04:22 PM
  3. Firefox 8 is breaking webforum “Quote” function.
    By JoJoRun in forum Technology & Internet
    Replies: 8
    Last Post: 03-12-2011, 02:26 PM
  4. Replies: 4
    Last Post: 22-01-2011, 06:22 PM
  5. Quote Estimate Form for Web Development
    By Brendan18 in forum Software Development
    Replies: 3
    Last Post: 30-06-2009, 11:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •