如何将查询字符串从.js页面传递到aspx页面 [英] How to pass query string from .js page to aspx page

查看:69
本文介绍了如何将查询字符串从.js页面传递到aspx页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hai

i需要通过查询字符串将日期从.js页面传递到.aspx页面我无法获取请帮助



这里的活动包含日期,描述和标题。



所以只得到我写的日期 - event.start.toLocaleString()







函数DisplayDetails( event ,element){
parent.location(' Calendarmessage.aspx?msgDate = + event.start.toLocaleString ()');

解决方案

hai

为什么你要将函数名称从updateevent更改为DisplayDetails?





 功能 DisplayDetails (事件,元素){
parent。 location ' Calendarmessage.aspx ?msgDate = + event.start.toLocaleString()');





ok首先尝试从DisplayDetails获取日期(活动,元素)



喜欢

 功能 DisplayDetails(event,element){

var dates = event.start.toLocaleString();
提醒(日期);
parent。 location ' Calendarmessage.aspx ?msgDate =' +日期);

}





首先你检查,你可以在日期变量中获取日期变量,如果是,只需通过查询字符串中的日期。

我不知道,你会得到日期,描述和标题,所以在选择日期之后这个事件会被激活吗?对吗?所以将3个值传递给calendarmessage.aspx页面,如



 <   pre     lang   =  Javascript >  function DisplayDetails(event,element){ 

var dates = event.start.toLocaleString();
var mess = event.mess.toLocaleString();
var title = event.title.toLocaleString();
window.parent.location.href =Calendarmessage.aspx?msgDate =+ dates +& msgtitle =+ title;

}
< / pre >


尝试类似



 function DisplayDetails(DateControl){
parent.location('Calendarmessage.aspx?msgDate = document.getElementById(<% = DateControl.ClientID %> )。value');
}


window.location ='http://www.test.com/somepage.aspx?q = 4';





window.onload = function(){window.location ='../newfoem.aspx?step=2';

Hai
i need to pass date from .js page to .aspx page through query string which i am not getting please help

Here event contains date, description and title.

so to get only date i am writing like this- event.start.toLocaleString()



function DisplayDetails(event, element) {
   parent.location('Calendarmessage.aspx?msgDate=+ event.start.toLocaleString()');

解决方案

hai
why u change function name form updateevent to DisplayDetails ?


function DisplayDetails(event, element) {
   parent.location('Calendarmessage.aspx?msgDate=+ event.start.toLocaleString()');



ok first try to get date from DisplayDetails(event,element)

like

function DisplayDetails(event, element) {

var dates=event.start.toLocaleString();
alert(dates);
   parent.location('Calendarmessage.aspx?msgDate='+ dates);

}



first u check ,u can get date in dates variable or not,if yes just pass dates in query string.
And i dont know,u will get date,description and title,so after date is selecte this event fires ? correct ? so pass 3 values to calendarmessage.aspx page like

<pre lang="Javascript">function DisplayDetails(event, element) {

var dates=event.start.toLocaleString();
var mess=event.mess.toLocaleString();
var title=event.title.toLocaleString();
  window.parent.location.href = "Calendarmessage.aspx?msgDate="+ dates + "&msgtitle=" + title;

}
</pre>


Try something like

function DisplayDetails(DateControl) {
parent.location('Calendarmessage.aspx?msgDate=document.getElementById("<%= DateControl.ClientID %>").value');
   }


window.location = 'http://www.test.com/somepage.aspx?q=4';

or
window.onload = function () { window.location = '../newfoem.aspx?step=2';


这篇关于如何将查询字符串从.js页面传递到aspx页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆