Jump to content
Sign in to follow this  
kaub0st3r

Get var in jQuery(aspx) from (aspx.cs)

Recommended Posts

kaub0st3r

tenho esta função em aspx(html)

function end(url) {

var url = getUrlVars(url);

var url2 = url["access_token"];

}

e quero no aspx.cs conseguir o valor do url2.

protected void Page_Load(object sender, EventArgs e)

{

string variableURL2 = ??????????????

}

encontrei esta solução na net mas não consigo que funcione:

aspx(html):

<asp:HiddenField Id="HiddenField1" runat="server"></asp:HiddenField>

na função:

document.getElementById("HiddenField1").value = url["access_token"];

no aspx.cs:

string variableURL2 = HiddenField1.Value;

Alguem sabe porque? O meu problema é com o token do facebook que preciso de guardar na base de dados, a minha ideia principal foi usar web forms .net, se as vezes alguem tiver soluções melhores agradeço ajuda :)


blogue: migalhasfrog.blogspot.comtwitter: ricardo_pt

Share this post


Link to post
Share on other sites
kaub0st3r

Sim tem o mesmo iD! já agora, e testando com textBox e um btn consigo ter acesso a informação, mas quando coloco Visible="false" deixo de ter acesso, porque? alguém sabe?


blogue: migalhasfrog.blogspot.comtwitter: ricardo_pt

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.