C# 如何使用RegisterStartupScript传递查询字符串?

C# 如何使用RegisterStartupScript传递查询字符串?,c#,javascript,jquery,asp.net,registerstartupscript,C#,Javascript,Jquery,Asp.net,Registerstartupscript,我的代码中有以下内容: ScriptManager.RegisterStartupScript(this, typeof(string), Guid.NewGuid().ToString().Replace("-", ""), "window.setTimeout(\" $('#" + calendar.ID + "').fullCalendar({header: {left: 'prev,next today',center: 'title',right: 'month,agendaWeek,

我的代码中有以下内容:

ScriptManager.RegisterStartupScript(this, typeof(string), Guid.NewGuid().ToString().Replace("-", ""), "window.setTimeout(\" $('#" + calendar.ID + "').fullCalendar({header: {left: 'prev,next today',center: 'title',right: 'month,agendaWeek,agendaDay'},aspectRatio: 2.2,editable: true,events: " + sJSON + ", eventClick: function(event) { OpenModal('Novo Compromisso','100%','500px','/agenda/form.aspx?compromissoid=event.id');}});\",100);", true);
它获取一些数据并加载日历的事件属性。在event上单击我要访问event.id以打开模式窗口并编辑事件。但是查询字符串被设置为“event.id”

我检查了event.id是否有值。因为它出现在alert()函数中,所以它有如下所示

ScriptManager.RegisterStartupScript(this, typeof(string), Guid.NewGuid().ToString().Replace("-", ""), "window.setTimeout(\" $('#" + calendar.ID + "').fullCalendar({header: {left: 'prev,next today',center: 'title',right: 'month,agendaWeek,agendaDay'},aspectRatio: 2.2,editable: true,events: " + sJSON + ", eventClick: function(event) { alert(event.id); OpenModal('Novo Compromisso','100%','500px','/agenda/form.aspx?compromissoid=event.id');}});\",100);", true);

那么,如何使用event.id值作为查询字符串?

在OpenModel调用中,将url从“/agenda/form.aspx?commissionsoid=event.id”更改为“/agenda/form.aspx?commissionsoid=”+event.id”

    ScriptManager.RegisterStartupScript(this, typeof(string), Guid.NewGuid().ToString().Replace("-", ""), "window.setTimeout(\" $('#" + calendar.ID + "').fullCalendar({header: {left: 'prev,next today',center: 'title',right: 'month,agendaWeek,agendaDay'},aspectRatio: 2.2,editable: true,events: " + sJSON + ", eventClick: function(event) { alert(event.id); OpenModal('Novo Compromisso','100%','500px','/agenda/form.aspx?compromissoid=' + event.id);}});\",100);", true);

如果您正在获取event.id,那么像这样使用它:soid='+event.id+''


非常感谢。这件事从昨天起就让我发疯了。现在我觉得自己很笨。
ScriptManager.RegisterStartupScript(this, typeof(string), Guid.NewGuid().ToString().Replace("-", ""), "window.setTimeout(\" $('#" + calendar.ID + "').fullCalendar({header: {left: 'prev,next today',center: 'title',right: 'month,agendaWeek,agendaDay'},aspectRatio: 2.2,editable: true,events: " + sJSON + ", eventClick: function(event) { alert(event.id); OpenModal('Novo Compromisso','100%','500px','/agenda/form.aspx?compromissoid='+event.id+'');}});\",100);", true);