[CLOSED] how can use Ext.urlEncode code behind

  1. #1

    [CLOSED] how can use Ext.urlEncode code behind

    Dim strURL as string 
            strURL = "http://127.0.01/url.aspx?ShopCode=" & HttpUtility.UrlEncode("Yphjcm+Lhcs=")
            '' "Yphjcm%2bLhcs%3d"  <-- debug.print out 
            lnkShopTarget.PostBackUrl = strURL 
            ''PostBackUrl contain "Yphjcm+Lhcs="  but not "Yphjcm%2bLhcs%3d"
    i try to al ext.urlencode but there no this method code behind. please help
    Last edited by Daniil; Jun 27, 2013 at 7:49 AM. Reason: [CLOSED]
  2. #2
    Hi @mis@adphk.com,

    The Ext.urlEncode is a client side JavaScript method. There is no way to use it in code behind.

    HttpUtility.UrlEncode() should work OK.

    In the output of the following page I see:
    onclick="javascript:WebForm_DoPostBackWithOptions(new  WebForm_PostBackOptions("Button1", "", false, "",  "http://127.0.01/url.aspx?ShopCode=Yphjcm%2bLhcs%3d", false, false))"
    So, the PostBackUrl is rendered as expected.

    Example
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            string strURL = "http://127.0.01/url.aspx?ShopCode=" + HttpUtility.UrlEncode("Yphjcm+Lhcs=");
                 
            this.Button1.PostBackUrl = strURL;
        }
    </script>
    
    <!DOCTYPE html>
    <html>
    <head runat="server">
        <title>Ext.NET v2 Example</title>
    </head>
    <body>
        <form runat="server">
            <asp:Button ID="Button1" runat="server" />
            
        </form>
    </body>
    </html>

Similar Threads

  1. .Hidden in Code behind reset to aspx code
    By bit9bug in forum 1.x Help
    Replies: 0
    Last Post: Apr 19, 2013, 8:11 AM
  2. Replies: 1
    Last Post: Nov 13, 2012, 1:36 PM
  3. Grid + MVC 3 + EF Code First + CRUD - Error code 200
    By millenovanta in forum 2.x Help
    Replies: 5
    Last Post: Sep 08, 2012, 4:31 PM
  4. Replies: 2
    Last Post: Feb 01, 2012, 6:56 AM
  5. Replies: 1
    Last Post: Jul 07, 2011, 8:34 PM

Tags for this Thread

Posting Permissions