在这种情况下找不到与控制有关的错误 [英] error regarding control is not found in this context

查看:78
本文介绍了在这种情况下找不到与控制有关的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的先生,

当我在本地系统上运行我的项目时,我得到一个错误是在当前上下文中找不到某些控件,例如Textbox,table,而当我在服务器上运行它时,它运行正常.

(例如,在.ascx.cs中,当.ascx文件包含TABLE3时,TABLE3不存在,并且以相同的方式包含更多)
我正在粘贴我的.ascx和.ascx.cs文件.

Dear Sir,

when i run my project on local system then i get an error is that some controls like Textbox,table does not found in the current context while when i run it on server it works fine.

(e.g. in .ascx.cs TABLE3 does not exist while .ascx file contains TABLE3 and in same way many more)
I am pasting my .ascx and .ascx.cs file.

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="userdownloads.ascx.cs" Inherits="control_userdownloads" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<table border="0" cellpadding="0" cellspacing="0" width="470" id="TABLE3" runat="server"  >
    <tr>
        <td align="center">
           <h3> If you already entered the below Information please enter only your Email.</h3></td>
    </tr>
    <tr>
        <td>
            <table id="TABLE2" runat="server" border="0" cellpadding="0" cellspacing="0" class="feedbackFrm" width="100%">
                <tr>
                    <td width="150px">
                        E-mail*:</td>
                    <td>
                        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><br /><asp:RequiredFieldValidator

                            ID="RequiredFieldValidator7" runat="server" ControlToValidate="TextBox1" Display="Dynamic"

                            ErrorMessage="Email Required!" ValidationGroup="sss"></asp:RequiredFieldValidator><asp:RegularExpressionValidator

                                ID="RegularExpressionValidator7" runat="server" ControlToValidate="TextBox1"

                                Display="Dynamic" ErrorMessage="Invalid Email!" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"

                                ValidationGroup="sss"></asp:RegularExpressionValidator></td>
                </tr>
                <tr>
                    <td>
                    </td>
                    <td>
                        <asp:Button ID="Button1" CssClass="btn" runat="server" Text="Submit" OnClick="Button1_Click" ValidationGroup="sss" /></td>
                </tr>
            </table>
            <table width="100%" id="TABLE1" runat="server" border="0" cellpadding="0" cellspacing="0" class="feedbackFrm">
                <tr>
                    <td width="150px">
                          Name*:</td>
                    <td >
                        <asp:TextBox ID="txtname" runat="server"></asp:TextBox><br /><asp:RequiredFieldValidator

                            ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtname" Display="Dynamic"

                            ErrorMessage="Name Required!" ValidationGroup="vldgrp"></asp:RequiredFieldValidator><asp:RegularExpressionValidator

                                ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtname" Display="Dynamic"

                                ErrorMessage="Invalid Name!" ValidationExpression="^[^<>%\/@#$]{3,50}$" ValidationGroup="vldgrp"></asp:RegularExpressionValidator></td>
                </tr>
                <tr>
                    <td>

                                Date of Birth*:</td>
                    <td >
                        <asp:TextBox ID="txtsdt" runat="server"></asp:TextBox><br />
                        <cc1:calendarextender id="CalendarExtender1" runat="server" format="d/M/yyyy" targetcontrolid="txtsdt"></cc1:calendarextender>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="txtsdt"

                            Display="Dynamic" ErrorMessage="Date of Birth Required!" ValidationGroup="vldgrp"></asp:RequiredFieldValidator>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator6" runat="server" ControlToValidate="txtsdt"

                            Display="Dynamic" ErrorMessage="Date of Birth!" ValidationExpression="^[^<>%\@#$]{3,50}$"

                            ValidationGroup="vldgrp"></asp:RegularExpressionValidator></td>
                </tr>
                <tr>
                    <td>

                                Father's Name*:</td>
                    <td >
                        <asp:TextBox ID="txtFname" runat="server"></asp:TextBox><br /><asp:RequiredFieldValidator

                            ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtFname" Display="Dynamic"

                            ErrorMessage="Father's Name Required!" ValidationGroup="vldgrp"></asp:RequiredFieldValidator><asp:RegularExpressionValidator

                                ID="RegularExpressionValidator2" runat="server" ControlToValidate="txtFname"

                                Display="Dynamic" ErrorMessage="Invalid Father's Name !" ValidationExpression="^[^<>%\/@#$]{3,50}$"

                                ValidationGroup="vldgrp"></asp:RegularExpressionValidator></td>
                </tr>
                <tr>
                    <td>
                        E-mail*:</td>
                    <td >
                        <asp:TextBox ID="txtemail" runat="server"></asp:TextBox><br /><asp:RequiredFieldValidator

                            ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtemail" Display="Dynamic"

                            ErrorMessage="Email Required!" ValidationGroup="vldgrp"></asp:RequiredFieldValidator><asp:RegularExpressionValidator

                                ID="RegularExpressionValidator3" runat="server" ControlToValidate="txtemail"

                                Display="Dynamic" ErrorMessage="Invalid Email!" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"

                                ValidationGroup="vldgrp"></asp:RegularExpressionValidator></td>
                </tr>
                <tr>
                    <td>
                                Phone No*:</td>
                    <td >
                        <asp:TextBox ID="txtphone" runat="server"></asp:TextBox><br /><asp:regularexpressionvalidator

                            id="RegularExpressionValidator9" runat="server" controltovalidate="txtphone"

                            display="Dynamic" errormessage="Invalid Phone" validationexpression="^[0-9-]{6,100}$"

                            validationgroup="vldgrp"></asp:regularexpressionvalidator>
                        <asp:requiredfieldvalidator id="RequiredFieldValidator14" runat="server" controltovalidate="txtphone"

                            display="Dynamic" errormessage="Enter Phone!" validationgroup="vldgrp"></asp:requiredfieldvalidator>
                    </td>
                </tr>
                <tr>
                    <td>

                                Mobile*:</td>
                    <td >
                        <asp:TextBox ID="txtMobile" runat="server"></asp:TextBox><br /><asp:RegularExpressionValidator

                            ID="Regularexpressionvalidator4" runat="server" ControlToValidate="txtMobile"

                            Display="Dynamic" ErrorMessage="Invalid Mobile" ValidationExpression="^[0-9-]{10,100}$"

                            ValidationGroup="vldgrp"></asp:RegularExpressionValidator>
                        <asp:RequiredFieldValidator ID="Requiredfieldvalidator4" runat="server" ControlToValidate="txtMobile"

                            Display="Dynamic" ErrorMessage="Enter Mobile!" ValidationGroup="vldgrp"></asp:RequiredFieldValidator></td>
                </tr>
                <tr>
                    <td>

                                City*:</td>
                    <td >
                        <asp:TextBox ID="txtCity" runat="server"></asp:TextBox><br /><asp:RequiredFieldValidator

                            ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtCity" Display="Dynamic"

                            ErrorMessage="City Required!" ValidationGroup="vldgrp"></asp:RequiredFieldValidator><asp:RegularExpressionValidator

                                ID="RegularExpressionValidator5" runat="server" ControlToValidate="txtCity" Display="Dynamic"

                                ErrorMessage="Invalid City!" ValidationExpression="^[^<>%\/@#$]{3,50}$" ValidationGroup="vldgrp"></asp:RegularExpressionValidator></td>
                </tr>
                <tr>
                    <td valign="top">
                        Degree interested in*</td>
                    <td valign="top">
                        <asp:CheckBoxList ID="CheckBoxList1" runat="server" RepeatColumns="5">
                            <asp:ListItem>Diploma</asp:ListItem>
                            <asp:ListItem>UG</asp:ListItem>
                            <asp:ListItem>PG</asp:ListItem>
                            <asp:ListItem>Research</asp:ListItem>
                            <asp:ListItem>Certificate</asp:ListItem>
                        </asp:CheckBoxList></td>
                </tr>
                <tr>
                    <td>
                    </td>
                    <td>
                        <asp:Button ID="btnSubmit" runat="server" CssClass="btn" Text="Submit" OnClick="btnSubmit_Click" ValidationGroup="vldgrp" /></td>
                </tr>
                <tr>
                    <td >
                    </td>
                    <td>
                      </td>
                </tr>
            </table>
        </td>
    </tr>
    <tr>
        <td>

</td>
    </tr>
</table>

<asp:DataList ID="dldown" runat="server" RepeatColumns="1" OnItemDataBound="dldown_ItemDataBound" CssClass="dwnld"><ItemTemplate>
  <h3> <asp:HyperLink ID="hyp" runat="server" Text='<%# Eval("hd") %>'  NavigateUrl='<%# "~/downloads/"+Eval("fname") %>' Target="_blank"></asp:HyperLink></h3>
   <p class="note" runat="server" id="noteid" visible='<%# getNote(Eval("nt")) %>'>
  <asp:Label ID="lblnt" runat="server" Text='<%# "<b>Note:</b> " + Eval("nt")%>' visible='<%# getNote(Eval("nt")) %>'></asp:Label></p>
   </ItemTemplate>
</asp:DataList>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
</asp:UpdatePanel>




and .ascx.cs file is
使用系统;
使用System.Data;
使用System.Configuration;
using System.Collections;
使用System.Web;
使用System.Web.Security;
使用System.Web.UI;
使用System.Web.UI.WebControls;
使用System.Web.UI.WebControls.WebParts;
使用System.Web.UI.HtmlControls;
使用System.Web.Mail;
using RichClass;


public partial class control_userdownloads : System.Web.UI.UserControl
{
adddownload ad = new adddownload();

受保护的void Page_Load(对象发送者,EventArgs e)
{
如果(!IsPostBack)
{
addnews adn = new addnews();
//TABLE3.Visible = true;
dldown.Visible = false;
bindDownLoad();
//if (Request.QueryString["uname"] != null)
//{
// if (Session["uname"].ToString() == "0")
//{

// object obj = RichClass.Security.DecryptData(Request.QueryString["uname"]);
// bool chk = adn.selUserfirsttime(obj.ToString());
// if (chk == true)
//{
// dldown.Visible = true;
// // TABLE3.Visible = false;
// Session["uname"] = TextBox1.Text;
// }
// else
//{
// showmessage("E-mail ID not matched! Please enter the below required information.");
// }
//}

//}
}
if (Session["uname"].ToString() != "0")
{
//TABLE3.Visible = false;
dldown.Visible = true;


}

}

public bool getNote(object objNote)
{
if (objNote == null || objNote == System.DBNull.Value || objNote.ToString() == " " || objNote.ToString() == "")
{
返回false;
}
其他
{
返回true;
}
}

void bindDownLoad()
{
DataSet ds;

ds = ad.SelectAllCourse();
如果(ds.Tables [0] .Rows.Count> 0)
{

dldown.DataSource = ds;
dldown.DataBind();
}
其他
{
dldown.Visible = false;
}
}

protected void dldown_ItemDataBound(object sender, DataListItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{

//DataSet d = ad.SelectAllCourse();
//string not = d.Tables[0].Rows[0]["nt"].ToString();
//if (not == "")
//{
// ((Label)e.Item.FindControl("lblnt")).Visible = false;
//}
//else
//{
// ((Label)e.Item.FindControl("lblnt")).Visible = true;
//}
}
}
protected void btnSubmit_Click(object sender, EventArgs e)
{

if (degree().ToString() != "")
{
addnews ad = new addnews();
//bool chk = ad.insertuser(txtname.Text, txtsdt.Text, txtFname.Text, txtemail.Text, txtphone.Text, txtMobile.Text, txtCity.Text, degree().ToString()); if (chk == true)
{


dldown.Visible = false;

showmessage("Congrats! Now you can download the available information!");

dldown.Visible = true;
TABLE3.Visible = false; Session["uname"] = txtemail.Text.Trim();

showmessage("Congrats! Now you can download information. please check your e-mail!");

string uname = RichClass.Security.EncryptData(txtemail.Text.Trim());
string url = "http://www.shridharuniversity.ac.in/download.aspx?uname=" + uname + "";

sendmail();
usermail(url);
clrall();
}
其他
{
showmessage("Your E-mail ID Already Exist!");

}
}
其他
{
showmessage("Please check atleast one interested Degree!");
}
}

public void showmessage(string str)
{
ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "clientScript", " alert(''" + str + "'')", true);
}

public string degree()
{
字符串str =";
foreach (ListItem ll in CheckBoxList1.Items)
{
if (ll.Selected == true)
{
str += ll.Text + ", ";
}
}

if (str == "")
{
}
其他
{
str = str.Substring(0, str.Length - 2);
}
return str;
}
public void clrall()
{
txtname.Text = "";
txtsdt.Text = "";
txtFname.Text = "";
txtemail.Text = "";
txtphone.Text = "";
txtMobile.Text = "";
txtCity.Text = "";

}
protected void lnkNewUser_Click(object sender, EventArgs e)
{

}
受保护的void Button1_Click(对象发送者,EventArgs e)
{
addnews ad = new addnews();
bool chk = ad.selUser(TextBox1.Text);

if (chk == true)
{
dldown.Visible = true;
TABLE3.Visible = false;
Session["uname"] = TextBox1.Text;
}
其他
{
showmessage("E-mail ID not matched! Please enter the below required information.");
}


}
protected void lnkLogin_Click(object sender, EventArgs e)
{

}
受保护的void LinkBut​​ton1_Click(对象发送者,EventArgs e)
{
Response.Redirect("test.aspx");
}

public void sendmail()
{

string message = "

Name:" + txtname.Text + "
Date of Birth:" + txtsdt.Text + "
Father''s Name:" + txtFname.Text + "
e-mail:" + txtemail.Text + "
Phone No:" + txtphone.Text + "
Mobile:" + txtMobile + "
City: " + txtCity.Text + "
Degree interested in " + degree().ToString() + "
";


string smtpServer = "mail.webshree.com";

int cdoBasic = 1;
int cdoSendUsingPort = 2;
System.Web.Mail.MailMessage objMail = new System.Web.Mail.MailMessage();

objMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserver", smtpServer);
objMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", 25);
objMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusing", cdoSendUsingPort);
objMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", cdoBasic);
objMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "adminmail@webshree.com");
objMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "okmijn#215");
//Dim objMail As New MailMessage
objMail.To = "info@shridharuniversity.ac.in";
objMail.Bcc = "webshri@gmail.com";
objMail.From = txtemail.Text;
objMail.Subject = "New Candidate@Download Section";
objMail.BodyFormat = MailFormat.Html;
objMail.Body = message;
试试
{
SmtpMail.SmtpServer = "mail.webshree.com";
SmtpMail.Send(objMail);
}
catch(ex ex例外)
{
//SmtpMail.Send(objMail);
}
}


public void usermail(string url)
{

string message = "
Dear " + txtname.Text + ",
Welcome to Shridhar University, for Download information please click below link:
" + url + "
";


string smtpServer = "mail.webshree.com";

int cdoBasic = 1;
int cdoSendUsingPort = 2;
System.Web.Mail.MailMessage objMail = new System.Web.Mail.MailMessage();

objMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserver", smtpServer);
objMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", 25);
objMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusing", cdoSendUsingPort);
objMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", cdoBasic);
objMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "adminmail@webshree.com");
objMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "okmijn#215");
//Dim objMail As New MailMessage
objMail.To = txtemail.Text.Trim();
objMail.Bcc = "webshri@gmail.com";
objMail.From = "info@shridharuniversity.ac.in";
objMail.Subject = "New Candidate@Download Section";
objMail.BodyFormat = MailFormat.Html;
objMail.Body = message;
试试
{
SmtpMail.SmtpServer = "mail.webshree.com";
SmtpMail.Send(objMail);
}
catch(ex ex例外)
{
//SmtpMail.Send(objMail);
}
}



}



I get error in .ascx.cs file which is bold in color.

Pls help me.

Thanks




and .ascx.cs file is
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Web.Mail;
using RichClass;


public partial class control_userdownloads : System.Web.UI.UserControl
{
adddownload ad = new adddownload();

protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
addnews adn = new addnews();
//TABLE3.Visible = true;
dldown.Visible = false;
bindDownLoad();
//if (Request.QueryString["uname"] != null)
//{
// if (Session["uname"].ToString() == "0")
// {

// object obj = RichClass.Security.DecryptData(Request.QueryString["uname"]);
// bool chk = adn.selUserfirsttime(obj.ToString());
// if (chk == true)
// {
// dldown.Visible = true;
// // TABLE3.Visible = false;
// Session["uname"] = TextBox1.Text;
// }
// else
// {
// showmessage("E-mail ID not matched! Please enter the below required information.");
// }
// }

//}
}
if (Session["uname"].ToString() != "0")
{
// TABLE3.Visible = false;
dldown.Visible = true;


}

}

public bool getNote(object objNote)
{
if (objNote == null || objNote == System.DBNull.Value || objNote.ToString() == " " || objNote.ToString() == "")
{
return false;
}
else
{
return true;
}
}

void bindDownLoad()
{
DataSet ds;

ds = ad.SelectAllCourse();
if (ds.Tables[0].Rows.Count > 0)
{

dldown.DataSource = ds;
dldown.DataBind();
}
else
{
dldown.Visible = false;
}
}

protected void dldown_ItemDataBound(object sender, DataListItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{

//DataSet d = ad.SelectAllCourse();
//string not = d.Tables[0].Rows[0]["nt"].ToString();
//if (not == "")
//{
// ((Label)e.Item.FindControl("lblnt")).Visible = false;
//}
//else
//{
// ((Label)e.Item.FindControl("lblnt")).Visible = true;
//}
}
}
protected void btnSubmit_Click(object sender, EventArgs e)
{

if (degree().ToString() != "")
{
addnews ad = new addnews();
//bool chk = ad.insertuser(txtname.Text, txtsdt.Text, txtFname.Text, txtemail.Text, txtphone.Text, txtMobile.Text, txtCity.Text, degree().ToString()); if (chk == true)
{


dldown.Visible = false;

showmessage("Congrats! Now you can download the available information!");

dldown.Visible = true;
TABLE3.Visible = false; Session["uname"] = txtemail.Text.Trim();

showmessage("Congrats! Now you can download information. please check your e-mail!");

string uname = RichClass.Security.EncryptData(txtemail.Text.Trim());
string url = "http://www.shridharuniversity.ac.in/download.aspx?uname=" + uname + "";

sendmail();
usermail(url);
clrall();
}
else
{
showmessage("Your E-mail ID Already Exist!");

}
}
else
{
showmessage("Please check atleast one interested Degree!");
}
}

public void showmessage(string str)
{
ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "clientScript", " alert(''" + str + "'')", true);
}

public string degree()
{
string str = "";
foreach (ListItem ll in CheckBoxList1.Items)
{
if (ll.Selected == true)
{
str += ll.Text + ", ";
}
}

if (str == "")
{
}
else
{
str = str.Substring(0, str.Length - 2);
}
return str;
}
public void clrall()
{
txtname.Text = "";
txtsdt.Text = "";
txtFname.Text = "";
txtemail.Text = "";
txtphone.Text = "";
txtMobile.Text = "";
txtCity.Text = "";

}
protected void lnkNewUser_Click(object sender, EventArgs e)
{

}
protected void Button1_Click(object sender, EventArgs e)
{
addnews ad = new addnews();
bool chk = ad.selUser(TextBox1.Text);

if (chk == true)
{
dldown.Visible = true;
TABLE3.Visible = false;
Session["uname"] = TextBox1.Text;
}
else
{
showmessage("E-mail ID not matched! Please enter the below required information.");
}


}
protected void lnkLogin_Click(object sender, EventArgs e)
{

}
protected void LinkButton1_Click(object sender, EventArgs e)
{
Response.Redirect("test.aspx");
}

public void sendmail()
{

string message = "

Name:" + txtname.Text + "
Date of Birth:" + txtsdt.Text + "
Father''s Name:" + txtFname.Text + "
e-mail:" + txtemail.Text + "
Phone No:" + txtphone.Text + "
Mobile:" + txtMobile + "
City: " + txtCity.Text + "
Degree interested in " + degree().ToString() + "
";


string smtpServer = "mail.webshree.com";

int cdoBasic = 1;
int cdoSendUsingPort = 2;
System.Web.Mail.MailMessage objMail = new System.Web.Mail.MailMessage();

objMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserver", smtpServer);
objMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", 25);
objMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusing", cdoSendUsingPort);
objMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", cdoBasic);
objMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "adminmail@webshree.com");
objMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "okmijn#215");
//Dim objMail As New MailMessage
objMail.To = "info@shridharuniversity.ac.in";
objMail.Bcc = "webshri@gmail.com";
objMail.From = txtemail.Text;
objMail.Subject = "New Candidate@Download Section";
objMail.BodyFormat = MailFormat.Html;
objMail.Body = message;
try
{
SmtpMail.SmtpServer = "mail.webshree.com";
SmtpMail.Send(objMail);
}
catch (Exception ex)
{
// SmtpMail.Send(objMail);
}
}


public void usermail(string url)
{

string message = "
Dear " + txtname.Text + ",
Welcome to Shridhar University, for Download information please click below link:
" + url + "
";


string smtpServer = "mail.webshree.com";

int cdoBasic = 1;
int cdoSendUsingPort = 2;
System.Web.Mail.MailMessage objMail = new System.Web.Mail.MailMessage();

objMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserver", smtpServer);
objMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", 25);
objMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusing", cdoSendUsingPort);
objMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", cdoBasic);
objMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "adminmail@webshree.com");
objMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "okmijn#215");
//Dim objMail As New MailMessage
objMail.To = txtemail.Text.Trim();
objMail.Bcc = "webshri@gmail.com";
objMail.From = "info@shridharuniversity.ac.in";
objMail.Subject = "New Candidate@Download Section";
objMail.BodyFormat = MailFormat.Html;
objMail.Body = message;
try
{
SmtpMail.SmtpServer = "mail.webshree.com";
SmtpMail.Send(objMail);
}
catch (Exception ex)
{
// SmtpMail.Send(objMail);
}
}



}



I get error in .ascx.cs file which is bold in color.

Pls help me.

Thanks

推荐答案

{3,50}


" ValidationGroup="vldgrp"></asp:RegularExpressionValidator></td> < /tr > < tr > < td > 出生日期*:< /td > <td > <asp:TextBox ID="txtsdt" runat="server"></asp:TextBox><br /> <cc1:calendarextender id="CalendarExtender1" runat="server" format="d/M/yyyy" targetcontrolid="txtsdt"></cc1:calendarextender> <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="txtsdt" span> Display="Dynamic" ErrorMessage="Date of Birth Required!" ValidationGroup="vldgrp"></asp:RequiredFieldValidator> <asp:RegularExpressionValidator ID="RegularExpressionValidator6" runat="server" ControlToValidate="txtsdt" span> Display="Dynamic" ErrorMessage="Date of Birth!" ValidationExpression="^[^<>%\@#
" ValidationGroup="vldgrp"></asp:RegularExpressionValidator></td> </tr> <tr> <td> Date of Birth*:</td> <td > <asp:TextBox ID="txtsdt" runat="server"></asp:TextBox><br /> <cc1:calendarextender id="CalendarExtender1" runat="server" format="d/M/yyyy" targetcontrolid="txtsdt"></cc1:calendarextender> <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="txtsdt" Display="Dynamic" ErrorMessage="Date of Birth Required!" ValidationGroup="vldgrp"></asp:RequiredFieldValidator> <asp:RegularExpressionValidator ID="RegularExpressionValidator6" runat="server" ControlToValidate="txtsdt" Display="Dynamic" ErrorMessage="Date of Birth!" ValidationExpression="^[^<>%\@#


{3,50}


这篇关于在这种情况下找不到与控制有关的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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