[System.Web.Services.WebMethodAttribute(), System.Web.Script.Services.ScriptMethodAttribute()]
public static string GetDynamicContent(string contextKey)
{
string outputString = string.Empty;
string strConn = ConfigurationManager.ConnectionStrings[""].ConnectionString;
SqlConnection dbConnection = new SqlConnection(strConn);
SqlCommand dbCommand = new SqlCommand
("SELECT TPM300_PAT_VISIT.vst_ext_id AS VisitID, FROM TABLE ......"
return outputString;
<asp:TextBox ID="txtMRN" runat="server" MaxLength="15"></asp:TextBox>
<asp:DynamicPopulateExtender ID="txtMRN_DynamicPopulateExtender" runat="server"
Enabled="True" PopulateTriggerControlID="btn_Go" ServiceMethod="GetDynamicContent"
TargetControlID="txtMRN" ContextKey="txtPatientId">
</asp:DynamicPopulateExtender>
<asp:TextBox ID="txtPatientId" runat="server" MaxLength="15"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ErrorMessage="*" ControlToValidate="txtPatientId"></asp:RequiredFieldValidator>
<asp:Button ID="btn_Go" runat="server" onclick="btn_Go_Click" Text="Lookup"
UseSubmitBehavior="False" CausesValidation="False" />
</td>
<td>
MRN:
<asp:TextBox ID="txtMRN" runat="server" MaxLength="15" ReadOnly="True"></asp:TextBox>
<asp:DynamicPopulateExtender ID="txtMRN_DynamicPopulateExtender" runat="server"
Enabled="True" PopulateTriggerControlID="btn_Go" ServiceMethod="GetDynamicContent"
TargetControlID="txtMRN">
</asp:DynamicPopulateExtender>
[System.Web.Services.WebMethodAttribute(), System.Web.Script.Services.ScriptMethodAttribute()]
public static string GetMRN(string PatientID)
{
string outputString = string.Empty;
string strConn = ConfigurationManager.ConnectionStrings[""].ConnectionString;
SqlConnection dbConnection = new SqlConnection(strConn);
SqlCommand dbCommand = new SqlCommand
("SELECT TPM300_PAT_VISIT.vst_ext_id AS VisitID, TPM300_PAT_VISIT.med_rec_no AS MRN WHERE TPM300_PAT_VISIT.vst_ext_id = '" + PatientID + "'", dbConnection);
-->>>> return strMRN;?????????????
}
}
SqlDataReader rdr = cmd.ExecuteReader();
String strMRN;
if(rdr.Read()) {
strMRN = rdr[1];
}
return strMRN;
On the server :
You need a to create a web service to receive the request from the server.
Your web service return the MRN number
Open in new window
On the client side just call
Open in new window