HTML代码在.net中转换(无法正常工作)

编程入门 行业动态 更新时间:2024-10-14 18:18:58
本文介绍了HTML代码在中转换(无法正常工作)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

HTML代码正在关注

HTML Code is following

<!-- start login box here --> <div class="fr"> <div class="loginbox"> <div class="loginboxbg"> <div class="ltop"> <div class="bleft"> <div class="bright"> <div style="padding: 5px 10px; height: 20px;" class="arial15"> <strong>MEMBERS LOGIN</strong> </div> <div style="padding: 5px 10px;"> <form action="208.101.14.59/sms/php/pass.php?go=login" method="post" name="form" id="form"> <div> <div class="fl" style="width: 155px;">Login Email:</div> <div class="fl" style="width: 20px;">&nbsp;</div> <div class="fl" style="width: 106px;">Password :</div> <div class="clear">&nbsp;</div> </div> <div> <div class="fl" style="width: 155px;"><input class="box1" name="email" type="text"></div> <div class="fl" style="width: 20px;">&nbsp;</div> <div class="fl" style="width: 106px;"> <input class="box2" name="pwd" type="password"></div> <div class="fl"> <input src="images/loginbutt.jpg" onclick="getElementById('form').submit()" type="image"> </div> <div class="clear">&nbsp;</div> </div> </form> </div> <div>&nbsp;</div> </div> </div> </div> </div> </div> </div> <!-- End login box here -->

我想在.Net中转换此代码,但它给出了一些错误. 请帮助我.

I want to convert this code in .Net but it is giving some error. Please help me.

推荐答案

嗨Vinodkumar, 我已根据您的要求修改了代码: 这是HTML代码 Hi Vinodkumar, I have modified code as per your requirement: This is HTML code <%@ Page Language="C#" AutoEventWireup="true" CodeFile="ZTest2.aspx.cs" Inherits="ZTest2" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "www.w3/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="www.w3/1999/xhtml"> <head id="Head1" runat="server"> <title></title> <script language="javascript" type="text/javascript"> alert('Invalid Email or Password!'); </script> </head> <body> <form id="form1" runat="server"> <div class="fr"> <div class="loginbox"> <div class="loginboxbg"> <div class="ltop"> <div class="bleft"> <div class="bright"> <div style="padding: 5px 10px; height: 20px;" class="arial15"> <strong>MEMBERS LOGIN</strong> </div> <div style="padding: 5px 10px;"> <form action="208.101.14.59/sms/php/pass.php?go=login" method="post" name="form" id="form"> <div> <div class="fl" style="width: 155px;"> Login Email:</div> <div class="fl" style="width: 20px;"> </div> <div class="fl" style="width: 106px;"> Password :</div> <div class="clear"> </div> </div> <div> <div class="fl" style="width: 155px;"> <asp:TextBox runat="server" ID="txtEmail" CssClass="box1"></asp:TextBox> </div> <div class="fl" style="width: 20px;"> </div> <div class="fl" style="width: 106px;"> <asp:TextBox runat="server" ID="txtPassword" CssClass="box2" TextMode="Password"></asp:TextBox> </div> <div class="fl"> <asp:ImageButton runat="server" ID="ibtnLogin" ImageUrl="mages/loginbutt.jpg" AlternateText="Click to login" onclick="ibtnLogin_Click" /> </div> <div class="clear"> </div> </div> </form> </div> <div> </div> </div> </div> </div> </div> </div> </div> </form> </body> </html>

这是服务器端代码

This is server side code

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class ZTest2 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void ibtnLogin_Click(object sender, ImageClickEventArgs e) { //Write your logic here... //suppose in database would have //Email=Imdadhusen.sunasara@gmail //Password=Imdad if (txtEmail.Text == "Imdadhusen.sunasara@gmail" && txtPassword.Text == "Imdad") { //Valid Email and Password //You can write page name here instead of ProductHome.aspx Response.Redirect("ProductHome.aspx"); } else { //Invalid Email or Password string strMessage = @" <script language='javascript' type='text/javascript'> alert('Invalid Email or Password!'); </script>"; Response.Write(strMessage); } } }

如有任何疑问,请让我知道. 如果对您有帮助,请提供投票. 谢谢, Imdadhusen

Please do let me know, if you have any doubt. Please provide Vote if this would be helpful to you. Thanks, Imdadhusen

更多推荐

HTML代码在.net中转换(无法正常工作)

本文发布于:2023-11-07 23:23:21,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1567712.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:无法正常   代码   工作   HTML   net

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!