asp.net网站中的帮助 [英] Help in asp.net website

查看:70
本文介绍了asp.net网站中的帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

我正在开发一个Intranet门户.我正在使用ajax弹出扩展器在面板上创建登录"页面.


我正在另一个项目下开发登录页面(也有一些其他页面).
现在,我正在将登录面板从另一个项目复制到Intranet门户主页.
然后

Intranet门户母版页登录控件上的信息显示在母版页设计以及CS文件中.

但在该控件上显示为蓝线(错误线)的TextBox1在当前上下文中不会退出.


hi to all

I am developing an intranet portal. i am using ajax pop up extender to make Login page on panel.


I am developing login page (some other pages also) under another project.
now i am copying login panel from another project to intranet portal master page.
then

on intranet portal master page login controls are shown on master page design as well as cs file.

but on that control a blue line(error line) shown as TextBox1 does not exit in current context.


SqlCommand cmd = new SqlCommand();
        cmd.CommandText = "hod_login";
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.Connection = Db.GetConnection();
        cmd.Parameters.AddWithValue("@LoginID", TextBox1.Text);
        cmd.Parameters.AddWithValue("@Password", TextBox2.Text);
        cmd.Parameters.AddWithValue("@UserType", DropDownList1.Text);
        SqlDataReader dr = cmd.ExecuteReader();
        if (dr.Read())
        {
            if (dr[2].ToString() == "Commercial" && DropDownList1.Text == "HOD")
            {
                Session["userid"] = TextBox1.Text;
                Session["tag"] = DropDownList1.Text;
                Session["deptt"] = "Commercial";
                //ViewState["deptt"] = "Commercial";
                Response.Redirect("onlineforms.aspx");
            }
            
        }
        else
        {
            
            Response.Write("Invalid User");
        }
    }



粗体控件显示错误
有什么问题,我不能低估.
请帮帮我.



bold controls are showing errors
What is the problem,i can not understatndinhg.
please help me.
thanks.

推荐答案

有时,当您复制aspx内容并将其粘贴到其他页面上时,有时会发生这种情况.打开网页的designer.cs文件,并确保存在TextBox1,TextBox2和DropDownList1的条目.即使在.aspx页中也可能缺少该文件.如果designer.cs缺少这些控件的条目,请按照
手动进行操作
受保护的全局:: TextBox TextBox1,依此类推.

这应该可以解决您的问题.
还要检查您的aspx页面是否引用了您正在使用的同一.cs文件.您可以在.aspx页面的第一行(代码隐藏"属性)进行检查.

希望这会有所帮助.
一切顺利.
This happens sometimes, when you copy the the aspx contents and paste it on some other page. Open the designer.cs file of the web page and make sure that there is an entry for TextBox1, TextBox2 and DropDownList1. It may be missing there even if it there in .aspx page. If designer.cs is missing the entry for these controls then do it manually as

Protected global :: TextBox TextBox1 and so on.

This should solve your problem.
Also check whether your aspx page is referring to the same .cs file that you are working in. You can check it in the first line of .aspx page (Code Behind attribute).

Hope this helps.
All the best.


您在此处共享的代码TextBox1声明不存在.
那就是问题所在.

TextBox2DropDownList1也会发生同样的情况.
The code you shared there declaration of TextBox1 is not there.
That is causing the problem.

The same will happen to TextBox2 and DropDownList1 also.


这篇关于asp.net网站中的帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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