本文介绍了Page_load仅出现一次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我希望我的应用程序在加载此页面时始终调用page_load
SearchBillType.aspx
I would like my application to always call the page_load when loading this page
SearchBillType.aspx
Imports System.Data
Imports System.IO
Imports System.Xml
Partial Class SearchDiagnosis
Inherits PageBase
Implements IPostBackEventHandler
Shadows IsCallBack As Boolean = False
Dim MAFunctions As New MAFunctions
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
LoadBillType() If IsPostBack AndAlso Request.Form("__AsyncPost") IsNot Nothing AndAlso Request.Form("__AsyncPost") = "true" Then
IsCallBack = True
End If
If Not IsPostBack And Not IsCallBack Then
If Not Session("BillTypeSelected") Is Nothing Then
Session.Remove("BillTypeSelected")
End If
End If
End Sub
此代码仅在我的应用程序首次加载此页面时被调用.
以下是我的主页中的摘录,其中显示了调用SearchBillType页面的Javascript代码
This code only gets called the first time my application loads this page.
The following is a snipet from my Main page showing the Javascript code which calls the SearchBillType Page
<script type="text/javascript">
var clientid = "";
var clientname = "";
function ShowModal(Mode, Width, Height) {
var browserName = navigator.appName;
switch (Mode.toLowerCase()) {
case "billtype":
var modalResult = window.showModalDialog(
"SearchBillType.aspx",
"resizable:no;scroll:yes;status:no;",
"dialogWidth:" + Width + ";dialogHeight:" + Height + ";center:yes"
);
document.getElementById("<%=btnParentChild.ClientId%>").click();
break;
}
}
谢谢.
Thank you.
推荐答案
这篇关于Page_load仅出现一次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!