Click here to Skip to main content
15,886,664 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hii ,
JavaScript
$(document).ready(function () {

    $("[id*=hlViewDetails]").click(function () {


        var eleID = $(this).attr("id");
        var strEndID = $(this).parent().find("[id*=hdnEndId]").val();
        if (strEndID != null && parseInt(strEndID) > 0) {
           

             <%
                ActusLibrary.Utils.SecureQueryString qstring = new ActusLibrary.Utils.SecureQueryString();
                qstring.ExpireTime = DateTime.Now + new TimeSpan(0, 5, 0, 0);
                qstring["e"] =strEndID 
            %>

ShowEndYearDetails(qstring);
        }

        return false;
    });

});

above is what i am trying to do , the reason for this is i cant deloy any dll , all i want to do is using script .. but on this code
JavaScript
qstring["e"] = strEndID 

i am not able to get it how to do that ... its giving me an error ..

Please help

I also tried something like this
JavaScript
$(document).ready(function () {

    $("[id*=hlViewDetails]").click(function () {
        var eleID = $(this).attr("id");
        var strMidID = $(this).parent().find("[id*=hdnMid]").val();
        if (strMidID != null && parseInt(strMidID) > 0) {
            var strMidID = '<%= getEncodedID("5")%>';
            ShowMidYearDetails(strMidID);
        }

        return false;
    });

});

string getEncodedID(string id)
{

    ActusLibrary.Utils.SecureQueryString qstring_1 = new ActusLibrary.Utils.SecureQueryString();
    qstring_1.ExpireTime = DateTime.Now + new TimeSpan(0, 5, 0, 0);
    qstring_1["m"] = id.ToString();

    return qstring_1.ToString().Trim();
}

here i want to pass strMid inside getEncodedID insted of hardsoded "5"
Posted
v4
Comments
What is the error?

ASP
<head runat="server">
    <title></title>
    <script language="c#" runat="server">
        protected void btnShowId_Click( object sender,EventArgs e )
        {
           string id= GenerateID(txtIdPre.Text);

           txtId.Text = id;
        
        }
        
        private  string GenerateID(string pre)
        {
            string id = null;
            id=pre+"_"+DateTime.Now.ToString();
            return id;
        
        }
</script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        ID Prefix: <asp:textbox id="txtIdPre" runat="server"</asp:textbox>
        <asp:button id="btnShowId" runat="server" text="Show Id" onclick="btnShowId_Click"  />
        Your generated Id:<asp:textbox id="txtId" runat="server" </asp:textbox>
    </div>
    </form>
</body>
 
Share this answer
 
v2
Comments
Torakami 18-Dec-14 0:22am    
for this i have to implement dll as well , otherwise it will give me an error ... onclick will generate on codebehind .. all i want to do is without dll loding
In aspx Page <% %>, use then symbols and you can write the code inside the block of codes
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900