|
|
|
สอบถามการใช้ Master Page asp.net c# หน่อยครับ ทำไมมันถึงโชว์ค่าไม่หมดครับ |
|
|
|
|
|
|
|
Master Page
Code (C#)
<%@ Master Language="C#" AutoEventWireup="true" %>
<%@ Import Namespace="System.Web.Mail"%>
<script runat="server">
void SendMail(object sender, EventArgs e)
{
if(Tel.Text != "")
{
MailMessage myMail = new MailMessage();
myMail.To = "[email protected]";
myMail.From = "[email protected]";
myMail.Subject = "ข้อความใหม่ " + DateTime.Now.ToString();
myMail.BodyFormat = MailFormat.Html;
myMail.Body = "สวัสดีครับ";
SmtpMail.SmtpServer = "102.123.41.21"; //*** Mail Server ***//
SmtpMail.Send(myMail);
myMail = null;
FullName.Text = null;
Tel.Text = null;
String scriptText = "return confirm('ท่านต้องการส่งข้อมูลใช่หรือไม่?')";
Page.ClientScript.RegisterOnSubmitStatement(this.GetType(),"ConfirmSubmit", scriptText);}
}
</script>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<asp:contentplaceholder id="Head" runat="server"></asp:contentplaceholder>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.css" />
<link href="Menu.css" rel="stylesheet" />
<style type="text/css">
.auto-style1 {
color: #FFFFFF;
font-size: x-large;
}
.auto-style2 {
color: #FFFFFF;
font-size: large;
}
.auto-style3 {
color: #FFFFFF;
font-size: medium;
}
</style>
</head>
<body style="background-color:#808080">
<form id="form1" runat="server">
<div style="background-color:white; background-repeat: no-repeat; margin:0 auto; width:950px; position : relative; top: 0px; left: 0px; right:0; bottom:0;">
<img src="https://placehold.it/1200x400?text=IMAGE" width="100%" height="300px" />
<div class="navbar navbar-default navbar-static-top">
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li><a href="#">Home</a></li>
<li><a href="#">Product</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Company</a></li>
</ul>
</div>
</div>
<div style="margin:15px;">
<a class="btn btn-primary" href="javascript:window.open('https://www.facebook.com/sharer/sharer.php?u='+document.URL,'mywindowtitle','width=600,height=600')"><i class="fa fa-facebook" aria-hidden="true"></i> Facebook</a>
<a class="btn btn-info" href="javascript:window.open('https://twitter.com/home?status='+document.URL,'mywindowtitle','width=600,height=600')"><i class="fa fa-twitter" aria-hidden="true"></i> Twitter</a>
<a class="btn btn-danger" href="javascript:window.open('https://plus.google.com/share?url='+document.URL,'mywindowtitle','width=600,height=600')"><i class="fa fa-google-plus" aria-hidden="true"></i> Google+</a>
<a class="btn btn-success" href="javascript:window.open('https://lineit.line.me/share/ui?url='+document.URL,'mywindowtitle','width=600,height=600')"><i class="fa fa-comment" aria-hidden="true"></i> Line</a>
</div>
<div style="padding:15px 30px 30px 30px;">
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</div>
<div style="margin:15px;">
<a class="btn btn-primary" href="javascript:window.open('https://www.facebook.com/sharer/sharer.php?u='+document.URL,'mywindowtitle','width=600,height=600')"><i class="fa fa-facebook" aria-hidden="true"></i> Facebook</a>
<a class="btn btn-info" href="javascript:window.open('https://twitter.com/home?status='+document.URL,'mywindowtitle','width=600,height=600')"><i class="fa fa-twitter" aria-hidden="true"></i> Twitter</a>
<a class="btn btn-danger" href="javascript:window.open('https://plus.google.com/share?url='+document.URL,'mywindowtitle','width=600,height=600')"><i class="fa fa-google-plus" aria-hidden="true"></i> Google+</a>
<a class="btn btn-success" href="javascript:window.open('https://lineit.line.me/share/ui?url='+document.URL,'mywindowtitle','width=600,height=600')"><i class="fa fa-comment" aria-hidden="true"></i> Line</a>
</div>
<div id="fb-root"></div>
<script>
(function (d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/th_TH/sdk.js#xfbml=1&version=v2.7";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
<div class="fb-comments" data-href="http://localhost:24781/" data-width="100%" data-numposts="10"></div>
</div>
<div style="background-color:#383838; background-repeat: no-repeat; margin:0 auto; width:950px; height:270px; position : relative; top: 0px; left: 0px; right:0; bottom:0;">
<table style="width:100%; height: 270px;">
<tr>
<td style="width:40%; padding:15px;" class="fa-inverse">
<table style="width:100%;">
<tr>
<td align="right">
<div class="form-group">
<asp:TextBox ID="FullName" runat="server" class="w3-border w3-padding" placeholder="ชื่อ-สกุล..." Width="80%" CssClass="form-control"></asp:TextBox></div>
</td>
</tr>
<tr>
<td align="right">
<div class="form-group">
<asp:TextBox ID="Tel" runat="server" class="w3-border w3-padding" placeholder="เบอร์โทร..." Width="80%" CssClass="form-control"></asp:TextBox></div>
</td>
</tr>
<tr>
<td align="right">
<asp:Button class="btn btn-warning" runat="server" UseSubmitBehavior="false" OnClientClick="this.disabled='true'; this.value='Please wait...';" Text='ส่งข้อมูล' ID="Button9" Width="80%" ForeColor="Black" OnClick="SendMail" />
</td>
</tr>
</table>
</td>
<td style="width:20%;vertical-align:top;" align="center">
<table style="margin-top:15px;">
<tr>
<td align="center">
<span class="auto-style1">ติดต่อสอบถาม</span>
</td>
</tr>
<tr>
<td align="center">
<br />
<br />
<img src="https://placehold.it/1200x400?text=IMAGE" width="120" height="120" style="border:5px solid #ff6a00; border-radius:50% 50% 50% 50%;" />
<br />
<br />
</td>
</tr>
</table>
</td>
<td style="width:40%;">
<span class="auto-style2">นายมารวย</span><br />
<span class="auto-style3">ก็ไม่รู้สินะ</span><br /><br />
<a href="tel:0811111111" class="btn btn-danger" >
<i class="glyphicon glyphicon-earphone">
0811111111
</i>
</a><br /><br />
<a href="#" target="_blank" class="btn btn-success" >
Line
</a>
<a href="#" target="_blank" class="btn btn-primary" >
Facebook
</a>
</td>
</tr>
</table>
</div>
<div style="background-color:#FFFFFF; background-repeat: no-repeat; margin:0 auto; width:950px; height:80px; position : relative; top: 0px; left: 0px; right:0; bottom:0; text-align:center; color:#383838; font-size:15px; line-height:80px;">
© 2016
</div>
</form>
</body>
</html>
Content Page
Code (C#)
<%@ Page Title='' Language='C#' MasterPageFile='~/Temp.Master' AutoEventWireup='true'%>
<asp:Content ID='Content1' ContentPlaceHolderID='Head' runat='server'>
<title>ทดสอบ</title>
<meta name='description' content='โปรแกรมอะไรก็ไม่รู้' />
<meta name='keywords' content='ทดสอบ,ทดสอบ1' />
<meta property='og:title' content='ทดสอบ' />
<meta property='og:description'content='โปรแกรมอะไรก็ไม่รู้'/>
<meta property='og:image' content='http://i.imgur.com/5NzFKC4.jpg' />
</asp:Content>
<asp:Content ID='Content2' ContentPlaceHolderID='ContentPlaceHolder1' runat='server'>
<p>asfsdfd</p>
</asp:Content>
คือผมเขียน โค้ดประมานนี้ครับ
ถ้าดูในคอม ข้อมูลทุกอย่างขึ้นปกติ ไม่มีปัญหาอะไรเลย
แต่พอเข้าไปดูผ่านมือถือ ข้อมูลตรงส่วนนี้ไม่แสดงค่าครับ(Master Page)
Code (C#)
<ul class="nav navbar-nav">
<li><a href="#">Home</a></li>
<li><a href="#">Product</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Company</a></li>
</ul>
ไม่ทราบว่า มันเกิดจากอะไรครับ
Tag : .NET, Web (ASP.NET), C#, VS 2012 (.NET 4.x)
|
|
|
|
|
|
Date :
2016-10-08 09:48:47 |
By :
Easy123 |
View :
1907 |
Reply :
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
มันถูก generate ออกมาเหมือนกันครับ แต่ css ทำไว้ไม่ครอบคลุม เลยไม่แสดงออกมา
แก้ไข css ให้ถูกเท่านั้นเองครับ
|
|
|
|
|
Date :
2016-10-08 12:57:25 |
By :
Chaidhanan |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ลอง View Source ในหน้า Web Browser ครับ ดูพวก CSS ต่าง ๆ ว่าตรงหรือไม่
|
|
|
|
|
Date :
2016-10-10 14:50:49 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 05
|