Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > .NET Framework > Forum > ผมต้องการใช้ jquery กับ asp.net จาก vs 2010 ร่วมกับ master page แต่เกิดปัญหาครับช่วยด้วยครับผม



 

ผมต้องการใช้ jquery กับ asp.net จาก vs 2010 ร่วมกับ master page แต่เกิดปัญหาครับช่วยด้วยครับผม

 



Topic : 098774

Guest




ผมเขียนเว็บด้วย vs 2010 ด้วยภาษา asp.net ที่ใช้ master page น่ะครับ
ตอนนี้ผมติดปัญหาที่ว่า ผมอยากจะใช้ jquery แต่ว่าผมไม่สามารถเรียกใช้ได้ครับ มีerror ครับ
JavaScript runtime error: '$' is undefined
ผมไม่ทราบว่าเกิดจากอะไรครับ
อันนี้ site.master ครับ
Code (ASP)
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.master.cs" Inherits="STWebSolution.SiteMaster" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head runat="server">
    <title></title>
    <link href="~/Styles/Site.css" rel="stylesheet" type="text/css" />
    <script src="~/jquery/js/jquery-1.9.1.js" type="text/javascript"></script>
    <script src="~/jquery/js/jquery-ui-1.10.3.custom.js" type="text/javascript"></script>
    <script src="~/jquery/js/jquery-ui-1.10.3.custom.min.js" type="text/javascript"></script>
    <link href="~/jquery/css/flick/jquery-ui-1.10.3.custom.css" rel="stylesheet" type="text/css" />
    <link href="~/jquery/css/flick/jquery-ui-1.10.3.custom.min.css" rel="stylesheet" type="text/css" />
    <script src="~/jquery/development-bundle/ui/jquery.ui.core.js" type="text/javascript"></script>
    <script src="~/jquery/development-bundle/ui/jquery.ui.effect-explode.js" type="text/javascript"></script>
    <asp:ContentPlaceHolder ID="HeadContent" runat="server">
    </asp:ContentPlaceHolder>
    
</head>
<body>
    <form runat="server">
    <div class="page">
        <div class="MainTitle">
            <div class="title">
            <h2>
                ST Web Application.
            </h2>
            </div>
             <div class="loginDisplay">
                <asp:LoginView ID="HeadLoginView" runat="server" EnableViewState="false">
                    <AnonymousTemplate>
                        <%--[ <a href="~/Account/Login.aspx" ID="HeadLoginStatus" runat="server" style="color:ThreeDDarkShadow">Log In</a> ]--%>
                        [ <a href="~/Login/LoginWeb.aspx" ID="HeadLoginStatus" runat="server" style="color:ThreeDDarkShadow">Log In</a> ]
                    </AnonymousTemplate>
                    <LoggedInTemplate>
                        Welcome <span class="bold"><asp:LoginName ID="HeadLoginName" runat="server" /></span>!
                        [ <asp:LoginStatus ID="HeadLoginStatus" runat="server" LogoutAction="Redirect" LogoutText="Log Out" LogoutPageUrl="~/"/> ]
                    </LoggedInTemplate>
                </asp:LoginView>
            </div>

        </div>
        <div class="MainMenu1">
                <asp:Menu ID="NavigationMenu" runat="server" CssClass="menu" EnableViewState="false" IncludeStyleBlock="false" Orientation="Horizontal">
                    <Items>
                        <asp:MenuItem NavigateUrl="~/Default.aspx" Text="หน้าแรก"/>
                        <asp:MenuItem NavigateUrl="~/Main/MainMenu.aspx" Text="ข้อมูลพื้นฐาน"/>
                        <asp:MenuItem Text="เพิ่มผู้ใช้"/>
                        <asp:MenuItem NavigateUrl="~/About.aspx" Text="เกี่ยวกับ"/>
                    </Items>
                </asp:Menu>
        </div>
        <div class="main">
            <asp:ContentPlaceHolder ID="MainContent" runat="server"/>
            

        </div>
        <div class="foot">
            <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
            
        </div>
        <div class="foot"><asp:Label ID="lblStatus" runat="server"></asp:Label></div>
    </div>
   
    </form>
</body>
</html>



อันนี้หน้าที่เกิด error ครับ
Code (ASP)
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Employee.aspx.cs" Inherits="STWebSolution.Main_config.Employee" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .style1
        {
            height: 22px;
        }
        .style2
        {
            height: 21px;
        }
        .style3
        {
            width: 69px;
        }
        .style4
        {
            width: 20%;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">   
    <script>
        $(function(){
            $("#TXBirth").datepicker();
        });
    </script>    
    <div class="main">
        <div class="MainContent">
        <table width="100%">
        <tr><td class="style2" width="60%"></td><td align="center">
                <asp:Label ID="Label21" runat="server" Text="ค้นหา"></asp:Label>
                </td></tr>
            <tr>
                <td align="right">
                <table border="0">
                <tr>
                    <td colspan="0" align="right" class="style1">
                        <asp:Label ID="Label19" runat="server" Text="รหัสพนักงาน"></asp:Label></td>
                    <td colspan="3" align="left" class="style1">
                        <asp:TextBox ID="TextBox14" runat="server" Width="64%" BorderStyle="None"></asp:TextBox>
                        <asp:Button ID="Button4" runat="server" BackColor="Aqua" BorderStyle="None" 
                            Height="18px" Text="ตรวจสอบ" Width="66px" />
                        <asp:Button ID="Button5" runat="server" BackColor="Red" BorderStyle="None" 
                            Height="18px" Text="ลบ" Width="66px" />
                    </td>
                </tr>
                <tr >
                    <td colspan="0" align="right">
                        <asp:Label ID="Label1" runat="server" Text="คำนำหน้า"></asp:Label></td>
                    <td colspan="0" align="left">
                        <asp:RadioButton ID="RaMR" runat="server" Text="นาย" BorderStyle="None" 
                            Width="45px" />
                        <asp:RadioButton ID="RaMIS" runat="server" Text="นาง" BorderStyle="None" 
                            Width="45px" />
                        <asp:RadioButton ID="RaMISS" runat="server" Text="นางสาว" BorderStyle="None" />
                    </td>
                    <td align="right"></td>
                    <td></td>
                </tr>
                <tr>
                    <td colspan="0" align="right">
                        <asp:Label ID="Label2" runat="server" Text="ชื่อ(ไทย)"></asp:Label></td>
                    <td colspan="0" align="left">
                        <asp:TextBox ID="TextBox1" runat="server" ontextchanged="TextBox1_TextChanged" 
                            Width="100%" BorderStyle="None"></asp:TextBox>
                    </td>
                    <td colspan="0" align="right">
                        <asp:Label ID="Label3" runat="server" Text="นามสกุล(ไทย)"></asp:Label></td>
                    <td colspan="0">
                        <asp:TextBox ID="TextBox2" runat="server" BorderStyle="None"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td colspan="0" align="right">
                        <asp:Label ID="Label4" runat="server" Text="ชื่อ(อังกฤษ)"></asp:Label></td>
                    <td colspan="0" align="left">
                        <asp:TextBox ID="TextBox3" runat="server" Width="100%" BorderStyle="None"></asp:TextBox>
                    </td>
                    <td colspan="0" align="right">
                        <asp:Label ID="Label5" runat="server" Text="นามสกุล(อังกฤษ)"></asp:Label></td>
                    <td colspan="0">
                        <asp:TextBox ID="TextBox4" runat="server" BorderStyle="None"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td colspan="0" align="right">
                        <asp:Label ID="Label6" runat="server" Text="วันเกิด"></asp:Label></td>
                    <td align="left">
                    

                        <asp:TextBox ID="TXBirth" runat="server" BorderStyle="None" Width="100%"></asp:TextBox>

                        

                        

                    </td>
                    <td></td>
                    <td></td>
                </tr>
                <tr>
                    <td colspan="0" align="right">
                        <asp:Label ID="Label7" runat="server" Text="สัญชาติ"></asp:Label></td>
                    <td colspan="0" align="left">
                        <asp:TextBox ID="TextBox5" runat="server" Width="100%" BorderStyle="None"></asp:TextBox>
                    </td>
                    <td colspan="0" align="right"><asp:Label ID="Label8" runat="server" Text="ศาสนา"></asp:Label></td>
                    <td colspan="0">
                        <asp:TextBox ID="TextBox6" runat="server" BorderStyle="None"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td colspan="0" align="right" valign="top">
                        <asp:Label ID="Label9" runat="server" Text="ที่อยู่"></asp:Label></td>
                    <td colspan="3" align="right">
                        <asp:ListBox ID="ListBox1" CssClass="myListBox" runat="server" Width="100%"></asp:ListBox>
                        </td>
                </tr>
                <tr>
                    <td colspan="0" align="right">
                        <asp:Label ID="Label10" runat="server" Text="ตำบล"></asp:Label></td>
                    <td colspan="0" align="left">
                        <asp:TextBox ID="TextBox7" runat="server" Width="100%" BorderStyle="None"></asp:TextBox>
                    </td>
                    <td colspan="0" align="right">
                        <asp:Label ID="Label11" runat="server" Text="อำเภอ"></asp:Label></td>
                    <td colspan="0">
                        <asp:TextBox ID="TextBox8" runat="server" BorderStyle="None"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td colspan="0" align="right">
                        <asp:Label ID="Label12" runat="server" Text="จังหวัด"></asp:Label></td>
                    <td colspan="0" align="left">
                        <asp:TextBox ID="TextBox9" runat="server" Width="100%" BorderStyle="None"></asp:TextBox>
                    </td>
                    <td colspan="0" align="right">
                        <asp:Label ID="Label13" runat="server" Text="รหัสไปรษณีย์"></asp:Label></td>
                    <td colspan="0">
                        <asp:TextBox ID="TextBox10" runat="server" BorderStyle="None"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td colspan="0" align="right">
                        <asp:Label ID="Label14" runat="server" Text="เลขที่บัตรประชาชน"></asp:Label></td>
                    <td colspan="3" align="right">
                        <asp:TextBox ID="TextBox11" runat="server" Width="100%" BorderStyle="None"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td colspan="0" align="right">
                        <asp:Label ID="Label15" runat="server" Text="เลขที่ใบขับขี่รถยนต์"></asp:Label></td>
                    <td colspan="3" align="right">
                        <asp:TextBox ID="TextBox12" runat="server" Width="100%" BorderStyle="None"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td colspan="0" align="right">
                        <asp:Label ID="Label16" runat="server" Text="เลขที่ใบขับขี่รถบันทุก"></asp:Label></td>
                    <td colspan="3" align="right">
                        <asp:TextBox ID="TextBox13" runat="server" Width="100%" BorderStyle="None"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td colspan="0" align="right">
                        <asp:Label ID="Label17" runat="server" Text="แผนก"></asp:Label></td>
                    <td colspan="3" align="left">
                        <asp:DropDownList ID="DropDownList1" CssClass="comboStyle" runat="server">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td colspan="0" align="right">
                        <asp:Label ID="Label18" runat="server" Text="ตำแหน่ง"></asp:Label></td>
                    <td colspan="3" align="left">
                        <asp:DropDownList ID="DropDownList2" CssClass="comboStyle" runat="server">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td colspan="4" align="center">
                        <asp:Button ID="Button1" runat="server" BorderStyle="None" Text="บันทึก" 
                            Width="50px" BackColor="Aqua" />
                        <asp:Button ID="Button2" runat="server" BorderStyle="None" Text="ล้าง" 
                            Width="50px" BackColor="Lime" />
                        <asp:Button ID="Button3" runat="server" BorderStyle="None" Text="ยกเลิก" 
                            Width="50px" BackColor="Red" />
                    </td>                        
                    </tr>
                </table>
                </td>                
            <td align="center" valign="top" width="40%">
            <table width="100%">
            <tr><td class="style2">
                <asp:Label ID="Label20" runat="server" Text="รหัสพนักงาน"></asp:Label>
                </td><td>
                <asp:TextBox ID="TextBox15" runat="server" Width="100%"></asp:TextBox>
                </td><td class="style4" rowspan="2">
                <asp:Button ID="Button6" runat="server" BackColor="Yellow" BorderStyle="None" 
                    Height="45px" Text="ค้นหา" Width="67px" />
                </td></tr>
            <tr><td align="right" class="style3">
                <asp:Label ID="Label22" runat="server" Text="ชื่อพนักงาน"></asp:Label>
            </td>
            <td align="left">
                <asp:TextBox ID="TextBox16" runat="server" Width="100%"></asp:TextBox>
            </td>
            
            </tr>
            <tr><td align="right" class="style3">
                &nbsp;</td>
            <td align="left">
                &nbsp;</td>
                <td class="style4"></td>
            </tr>
            <tr><td colspan="3">
                &nbsp;</td></tr>
            <tr><td colspan="3">
                <asp:Button ID="Button7" runat="server" BackColor="Aqua" BorderStyle="None" 
                    Text="รายงาน" />
                </td></tr>
            </table>
            </td>
            </tr>
            
        </table>    
        </div>    
    </div>
</asp:Content>



จะเกิด error ในส่วนนี้ครับ

<script>
        $(function(){
            $("#TXBirth").datepicker();
        });
    </script> 


ผมไม่แน่ใจเรื่องการแทรกโค๊ดว่าถูกต้องหรือไม่แนะนำด้วยครับกำลังศึกษาครับผม
รบกวนพี่ๆแนะนำด้วยครับ
ขอบคุณครับ



Tag : .NET, Web (ASP.NET), VS 2010 (.NET 4.x)







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2013-08-06 23:10:22 By : รัฐพงษ์ View : 2573 Reply : 13
 

 

No. 1



โพสกระทู้ ( 74,058 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook

Quote:
JavaScript runtime error: '$' is undefined


เหมือบกับว่ายังไม่รู้จัก jQuery เลยครับ ลองตรวจสอบพวก Path ถุกต้องหรือเปล่าครับ






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-08-07 06:15:54 By : mr.win
 


 

No. 2

Guest


ครับผมก็เดาว่าเป็นอย่างนั้นแต่ก็ยังไม่แน่ใจจะทำยังไงดีน่ะครับ

ขอบคุณมากครับสำหรับคำแนะนำ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-08-08 01:21:42 By : รัฐพงษ์
 

 

No. 3



โพสกระทู้ ( 1,348 )
บทความ ( 1 )



สถานะออฟไลน์


Use absolute paths rather than relative ones

Code
<script type="text/javascript" src="/js/jquery.tools.min.js"></script>
<script type="text/javascript" src="/js/jquery.lavalamp.min.js"></script>
<link rel="stylesheet" type="text/css" href="/css/scrollable-buttons.css" />

Make sure the path begins with "/" for the root of your site, then wherever your js and css folders are. If they are both in the root then the above will work fine.

http://forums.asp.net/t/1886166.aspx/1?jquery+not+working+with+master+page
ตัวหนอนใช้กับพวกที่มี runat server จะเวิร์ค. เข้าใจว่าเป็นเช่นนั้น
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-08-08 06:19:52 By : watcharop
 


 

No. 4

Guest


ตอบความคิดเห็นที่ : 3 เขียนโดย : watcharop เมื่อวันที่ 2013-08-08 06:19:52
รายละเอียดของการตอบ ::
ไม่เป็นทุกกรณีหรอกนะ เราเองก็งง บางทีใช้ได้บางทีก็ไม่ได้

ถ้าลอง create project จากตัวอย่างของ vs มันก็ใช้ตัวหนอนกับ

path ของ script เหมือนกันนะ แต่ถ้าเราลองเขียนใช้ตัวหนอนเองกลับใช้ไม่ได้

ไม่รู้ต้องไป config ตรงไหน

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-08-08 06:30:48 By : ห้ามตอบเกินวันละ 2 กระทู้
 


 

No. 5



โพสกระทู้ ( 1,348 )
บทความ ( 1 )



สถานะออฟไลน์


ตอบความคิดเห็นที่ : 4 เขียนโดย : ห้ามตอบเกินวันละ 2 กระทู้ เมื่อวันที่ 2013-08-08 06:30:48
รายละเอียดของการตอบ ::
VS2010 พอลาก script มาใส่ในหน้าของ aspx มันไม่ได้ใส่ตัวหนอนนะ

ที่บ้านผมเป็นแบบนี้
<script src="../js/jquery-1.10.1.min.js" type="text/javascript"></script>


แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-08-08 09:44:42 By : watcharop
 


 

No. 6



โพสกระทู้ ( 1,348 )
บทความ ( 1 )



สถานะออฟไลน์


กรณีที่ต้องการ include script ในหน้าของ aspx แบ่งเป็น 2 กรณี

1. หาก include ที่ page ทั่วๆ ไป แค่ลากไฟล์ script มาใส่ VS จะสร้าง tag script ให้ จะใช้งานได้อย่างไม่มีปัญหา

2. กรณีที่ต้องการ include ที่ master page
การลากไฟล์ script มาใส่ VS จะสร้าง tag script โดยเปรียบเทียบ path script กับ path ของ masterpage และจะสร้าง relative path โดย ใช้เครื่องหมาย "." เช่น
Code
<script src="../js/jquery-1.10.1.min.js" type="text/javascript"></script>

กรณีนี้ ถ้า Page กับ master page อยู่ในโฟลเดอร์เดียวกัน จะทำงานได้อย่างไม่เกิดปัญหา
แต่ถ้าอยู่คนละโฟลเดอร์ อาจเกิดปัญหาได้ แต่ไม่เสมอไป
วิธีการตรวจสอบว่า จะเกิดปัญหาหรือไม่ ให้ลองลากไฟล์ script ไปไว้ที่ page แล้วดูว่า VS สร้าง relative path เหมือนกันหรือไม่ ถ้าเหมือนกัน แสดงว่าใช้ได้
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-08-08 10:00:10 By : watcharop
 


 

No. 7

Guest


ตอบความคิดเห็นที่ : 5 เขียนโดย : watcharop เมื่อวันที่ 2013-08-08 09:44:42
รายละเอียดของการตอบ ::
มัน generate ให้แบบนี้จริงๆ

ไม่เชื่อลอง new project -> visual c# -> web -> asp.net web application ดูสิ


หน้า master page มันเป็นแบบนี้

Site.master
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.master.cs" Inherits="WebApplication1.SiteMaster" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head runat="server">
    <title></title>
    <link href="~/Styles/Site.css" rel="stylesheet" type="text/css" />
    <asp:ContentPlaceHolder ID="HeadContent" runat="server">
    </asp:ContentPlaceHolder>
</head>
<body>
    <form runat="server">
    <div class="page">
        <div class="header">
            <div class="title">
                <h1>
                    My ASP.NET Application
                </h1>
            </div>
            <div class="loginDisplay">
                <asp:LoginView ID="HeadLoginView" runat="server" EnableViewState="false">
                    <AnonymousTemplate>
                        [ <a href="~/Account/Login.aspx" ID="HeadLoginStatus" runat="server">Log In</a> ]
                    </AnonymousTemplate>
                    <LoggedInTemplate>
                        Welcome <span class="bold"><asp:LoginName ID="HeadLoginName" runat="server" /></span>!
                        [ <asp:LoginStatus ID="HeadLoginStatus" runat="server" LogoutAction="Redirect" LogoutText="Log Out" LogoutPageUrl="~/"/> ]
                    </LoggedInTemplate>
                </asp:LoginView>
            </div>
            <div class="clear hideSkiplink">
                <asp:Menu ID="NavigationMenu" runat="server" CssClass="menu" EnableViewState="false" IncludeStyleBlock="false" Orientation="Horizontal">
                    <Items>
                        <asp:MenuItem NavigateUrl="~/Default.aspx" Text="Home"/>
                        <asp:MenuItem NavigateUrl="~/About.aspx" Text="About"/>
                    </Items>
                </asp:Menu>
            </div>
        </div>
        <div class="main">
            <asp:ContentPlaceHolder ID="MainContent" runat="server"/>
        </div>
        <div class="clear">
        </div>
    </div>
    <div class="footer">
        
    </div>
    </form>
</body>
</html>

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-08-08 10:34:39 By : ห้ามตอบเกินวันละ 2 กระทู้
 


 

No. 8



โพสกระทู้ ( 1,348 )
บทความ ( 1 )



สถานะออฟไลน์


ตอบความคิดเห็นที่ : 7 เขียนโดย : ห้ามตอบเกินวันละ 2 กระทู้ เมื่อวันที่ 2013-08-08 10:34:39
รายละเอียดของการตอบ ::
เข้าใจล่ะ Web App Project กับ Web Site Project
VS Gen ต่างกัน

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-08-08 10:37:09 By : watcharop
 


 

No. 9



โพสกระทู้ ( 1,348 )
บทความ ( 1 )



สถานะออฟไลน์


1. กรณีต้องการ Include jQuery ที่ master page
2. Page ที่ Implement master page นี้ สามารถอยู่โฟลเดอร์ใดๆ ก็ได้
3. สามารถทำงานได้ทั้งขณะรันบน ASP.NET Development Server และ Production IIS Server

ผมทดสอบกับ Web Site Project นะครับ
ไม่รู้ว่า Web Application Project จะเวิร์คไหม

หน้า Master Page
<!DOCTYPE html>

<html>
<head runat="server">
    <title></title>

    <asp:ContentPlaceHolder id="headPlaceHolder" runat="server">
    </asp:ContentPlaceHolder>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ContentPlaceHolder id="bodyPlaceHolder" runat="server">
        </asp:ContentPlaceHolder>
    </div>
    </form>
    <!-- add javascript here -->
    <script type="text/javascript">
            $(document).ready(function () {
                alert("jQuery ready()");
            });
    </script>
</body>
</html>


ที่ Page Load ก็ใส่แค่นี้
    Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
        Me.Page.ClientScript.RegisterClientScriptInclude("jquery", Me.ResolveClientUrl("~/js/jquery-1.10.1.min.js"))
    End Sub

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-08-08 10:42:56 By : watcharop
 


 

No. 10

Guest


ขอบคุณทุกท่านครับผมขอทดลองก่อนครับว่าเป็นเช่นใดบ้าง
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-08-08 23:33:25 By : รัฐพงษ์
 


 

No. 11

Guest


ตอนนี้หากประกาศที่ site.master สามารถทำได้แค่ หน้า site.master ครับ
ผมยังไม่สามารถทำที่ หน้าเว็บที่เพิ่มเข้าไปโดยแทรก code ที่ Content ได้ ไม่แสดงข้อมูลอะไรเลยน่ะครับ
ใครทำได้พอมีตัวอย่างขอดูเป็นแนวทางหน่อยนะครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-08-08 23:44:09 By : รัฐพงษ์
 


 

No. 12

Guest


ทำได้แล้วครับ
ในหน้าเว็บที่เพิ่มเข้าไปโดยแทรก code ที่ HeaderContent แบบนี้ก็จะได้ครับ แต่ทำที่ site.master จะไม่ได้หรืออาจจะได้ผมไม่แน่ใจนะครับ
แล้วส่วนของ TextBox1 VS มัน Generate ใหม่ให้ผมน่ะครับเป็น MainContent_TextBox1ครับทำแบบนี้ไปก็ใช้ได้ครับ งง ตั้งนานครับผม

Code (ASP)
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
    <script src="../jquery/js/jquery-1.9.1.js" type="text/javascript"></script>
    <script src="../jquery/js/jquery-ui-1.10.3.custom.js" type="text/javascript"></script>
    <script src="../jquery/js/jquery-ui-1.10.3.custom.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            $("#MainContent_TextBox1").datepicker();
        });
    </script>  
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-08-08 23:56:22 By : รัฐพงษ์
 


 

No. 13



โพสกระทู้ ( 74,058 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook


แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-08-09 06:27:35 By : mr.win
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : ผมต้องการใช้ jquery กับ asp.net จาก vs 2010 ร่วมกับ master page แต่เกิดปัญหาครับช่วยด้วยครับผม
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 01
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่