登录页面图像控件 [英] log in page image control
问题描述
各个身体,
我有一个包含2个文本框和按钮的登录页面。我想将图像控件添加到页面作为样式。当我运行程序时图像不显示。它显示为(x)或不可用。然后当我从我的页面注销并重定向到相同的登录页面时,图像出现!!为什么会这样。
我想要的是当我运行项目(登录是开始页面)时图像出现。
谢谢你
如果你想在页面加载上,为什么不给你的源页面提供图片网址?
这应该可以完成这项工作 -
< asp:image id = Image1 runat = server < span class =code-attribute> imagealign = 中间 imageurl = 〜/ Images / LiveRadio.jpg xmlns:asp = #unknown > < / asp:image >
确保您浏览了网址而非复制过去或手写。
希望,这有帮助:)
更新
请确保您已评论过以下内容
受保护 void Page_Load( object sender,EventArgs e)
{
// Image1.ImageUrl =〜/ Images / LiveRadio.jpg;
}
在解决方案中添加类似LoginMaster.master的母版页,并在其中添加Login.aspx所需的所有样式。如果要显示在登录页面的顶部,同时添加左右徽标等。使用LoginMaster.master创建所需的Login.aspx。
希望有所帮助,
谢谢
身体标签内:
< 表格 id = form1 runat = server >
< div >
< asp:Image ID = Image1 runat = server ImageAlign = 中间 / >
< br / >
< br / >
< br / >
< asp:标签 ID = Label1 runat = server 文字 = 用户名 Font-Bold = 真
字体大小 = 大 ForeColor = #FF6600 > < / asp:Label >
< asp:TextBox ID = TextBox1 runat = server style = margin-bottom:0px > < / asp:TextBox>
< br / >
< span class =code-keyword>< br / >
< asp:Label ID = Label2 runat = server 文字 = 密码 字体粗体 < span class =code-keyword> = True
< span class =code-attribute>
字体大小 = 大 ForeColor = #FF6600 > < / asp:标签 >
< asp:TextBox < span class =code-attribute> ID = TextBox2 runat = 服务器 > < / asp:TextBox >
< br / >
< br / >
< / div >
< / form >
代码背后:
受保护 void Page_Load( object sender,EventArgs e)
{
Image1.ImageUrl = 〜/ Images / LiveRadio.jpg;
}
hi every body,,
i have a login page that contains 2 text boxes and button. i want to add image control to page as style. when i run program the image not display., it is appear just as (x) or unavailable. then when i logout from my page and redirect to the same login page the image appear!!. why thats happen.
what i want is when i run the project (the login is start page) the image appear.
thank you
Why don't you give the image url from you source page if you want that on the pageload ?
This should do the job-
<asp:image id="Image1" runat="server" imagealign="Middle" imageurl="~/Images/LiveRadio.jpg" xmlns:asp="#unknown"></asp:image>
Make sure that you have browsed the url instead of copy past or writing manually.
Hope, this helps :)
Update
Make sure that you have commented following
protected void Page_Load(object sender, EventArgs e) { //Image1.ImageUrl = "~/Images/LiveRadio.jpg"; }
Add a master page like LoginMaster.master in your solutions and add all the styling required for Login.aspx in the same. At the same time you add left and right logos etc. if you want to display at the top of the login page. Create the required Login.aspx using LoginMaster.master.
Hope that helps,
Thanks
Inside the body tag :
<form id="form1" runat="server"> <div> <asp:Image ID="Image1" runat="server" ImageAlign="Middle"/> <br /> <br /> <br /> <asp:Label ID="Label1" runat="server" Text="User Name" Font-Bold="True" Font-Size="Large" ForeColor="#FF6600"></asp:Label> <asp:TextBox ID="TextBox1" runat="server" style="margin-bottom: 0px"></asp:TextBox> <br /> <br /> <asp:Label ID="Label2" runat="server" Text="Password" Font-Bold="True" Font-Size="Large" ForeColor="#FF6600"></asp:Label> <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox> <br /> <br /> </div> </form>
Code behind :
protected void Page_Load(object sender, EventArgs e) { Image1.ImageUrl = "~/Images/LiveRadio.jpg"; }
这篇关于登录页面图像控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!