Click here to Skip to main content
15,899,679 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello,

I made very simple aspx without masterpage. I attached jquery from CDN and then copy/pasted jquery tab sample code from jquery site. It doesnt work however:

ASP.NET
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication12.WebForm1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
	<title></title>	
	<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" type="text/javascript"></script>
	<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js" type="text/javascript"></script>
		<script>
			$(function ()
			{
				$("#tabs").tabs();
			});
	</script>
</head>
<body>
	<form id="form1" runat="server">
	<div id="tabs">
		<ul>
			<li><a href="#tabs-1">Nunc tincidunt</a></li>
			<li><a href="#tabs-2">Proin dolor</a></li>
			<li><a href="#tabs-3">Aenean lacinia</a></li>
		</ul>
		<div id="tabs-1">
			<p>
				Proin elit </p>
		</div>
		<div id="tabs-2">
			<p>
				Morbi tincidunt, </p>
		</div>
		<div id="tabs-3">
			<p>
				Mauris eleifend </p>
		</div>
	</div>
	</form>
</body>
</html>


What may be the reason?
Posted

You have not included the jQuery UI CSS file. Try this:

JavaScript
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>


1. First include the jQuery UI css file.
2. Next the jQuery latest js file.
3. Next the jQuery UI js file.

Hope this helps!
 
Share this answer
 
v4
Hello,
You have not included css file
Include following in head section :
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900