Hello sir
this is my code page
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
public partial class myprofile : System.Web.UI.Page
{
string strConnString = ConfigurationManager.ConnectionStrings["conString"].ConnectionString;
protected void Page_Load(object sender, EventArgs e)
{
DataTable dt = new DataTable();
string constr = ConfigurationManager.ConnectionStrings["conString"].ConnectionString;
SqlConnection con = new SqlConnection(constr);
string query = "SELECT tbl_user.email, myselfprofileClient.clientName, myselfprofileClient.clientImages, myselfprofileClient.CompanyDescription, myselfprofileClient.WebUrl, tbl_user.name,tbl_user.mobileNumber, tbl_user.password, tbl_user.repassword, tbl_user.professions, tbl_user.organisation, tbl_user.webUrl AS Expr1, tbl_user.activated, myselfprofileAddress.MobileNumber AS Expr2, myselfprofileAddress.UserAddress, myselfprofileaboutUs.aboutUs, myselfprofileheader.profile_pic, myselfprofileheader.headerimage, myselfprofileheader.facebookPageLink, myselfprofileheader.twitterPageLink, myselfprofileheader.googlePageLink, myselfprofileheader.linkedinPageLink, myselfprofileheader.headerSlidertext1, myselfprofileheader.headerSlidertext2, myselfprofileheader.headerSlidertext3, myselfprofileheader.headerSlidertext4, myselfprofileservices.servicesheader, myselfprofileservices.servicesone, myselfprofileservices.serviceoneDescription, myselfprofileservices.servicestwo, myselfprofileservices.servicetwoDescription, myselfprofileservices.servicesthree, myselfprofileservices.servicethreeDescription, myselfprofileservices.servicesfour, myselfprofileservices.servicefourDescription FROM tbl_user INNER JOIN myselfprofileaboutUs ON tbl_user.email = myselfprofileaboutUs.email INNER JOIN myselfprofileAddress ON tbl_user.mobileNumber = myselfprofileAddress.MobileNumber INNER JOIN myselfprofileClient ON tbl_user.email = myselfprofileClient.email INNER JOIN myselfprofileheader ON tbl_user.email = myselfprofileheader.email INNER JOIN myselfprofileservices ON tbl_user.email = myselfprofileservices.email where tbl_user.WebUrl="+Request.QueryString["WebUrl"];
SqlCommand cmd = new SqlCommand(query);
SqlDataAdapter sda = new SqlDataAdapter();
cmd.CommandType = CommandType.Text;
cmd.Connection = con;
sda.SelectCommand = cmd;
sda.Fill(dt);
if (dt.Rows.Count > 0)
{
//to set profile pic in main page
byte[] bytes = (byte[])dt.Rows[0]["profile_pic"];
string base64String = Convert.ToBase64String(bytes, 0, bytes.Length);
Image1.ImageUrl = "data:image/png;base64," + base64String;
// to show footer image in main page
byte[] bytesfooter = (byte[])dt.Rows[0]["profile_pic"];
string base64Stringfooter = Convert.ToBase64String(bytesfooter, 0, bytesfooter.Length);
footerimg.ImageUrl = "data:image/png;base64," + base64Stringfooter;
//to show slider image in main page
byte[] bytesh = (byte[])dt.Rows[0]["headerimage"];
string base64Stringh = Convert.ToBase64String(bytesh, 0, bytesh.Length);
Image2.ImageUrl = "data:image/png;base64," + base64Stringh;
lblfblink.Text = dt.Rows[0]["facebookPageLink"].ToString();
lblTwitter.Text = dt.Rows[0]["twitterPageLink"].ToString();
lblGooglepluse.Text = dt.Rows[0]["googlePageLink"].ToString();
lbllinkedin.Text = dt.Rows[0]["linkedinPageLink"].ToString();
lbltextslider1.Text = dt.Rows[0]["headerSlidertext1"].ToString();
lbltextslider2.Text = dt.Rows[0]["headerSlidertext2"].ToString();
lbltextslider3.Text = dt.Rows[0]["headerSlidertext3"].ToString();
lbltextslider4.Text = dt.Rows[0]["headerSlidertext4"].ToString();
lblheader.Text = dt.Rows[0]["servicesheader"].ToString(); //Where ColumnName is the Field from the DB that you want to display
lblserviceone.Text = dt.Rows[0]["servicesone"].ToString();
lblserviceonedec.Text = dt.Rows[0]["serviceoneDescription"].ToString();
lblservicesecond.Text = dt.Rows[0]["servicestwo"].ToString();
lblserviceseconddec.Text = dt.Rows[0]["servicetwoDescription"].ToString();
lblservicethird.Text = dt.Rows[0]["servicesthree"].ToString();
lblservicethirddec.Text = dt.Rows[0]["servicethreeDescription"].ToString();
lblservicefourth.Text = dt.Rows[0]["servicesfour"].ToString();
lblservicefourthdec.Text = dt.Rows[0]["servicefourDescription"].ToString();
lblboutUs.Text = dt.Rows[0]["aboutUs"].ToString();
}
else
{
Response.Redirect("~/headerpage.aspx?=EmailId");
}
getDataAddress();
getClientData();
}
private void getClientData()
{
DataTable dt = new DataTable();
SqlConnection connection = new SqlConnection(strConnString);
connection.Open();
SqlCommand sqlCmd = new SqlCommand("SELECT [myprifileclientId],[email],[clientName],[clientImages],[CompanyDescription],[WebUrl] FROM [db_myprofile].[dbo].[myselfprofileClient] WHERE email='" + Session["EmailId"] + "'", connection);
SqlDataAdapter sqlDa = new SqlDataAdapter(sqlCmd);
//sqlCmd.Parameters.AddWithValue("@username", user);
//sqlDa.Fill(dt);
DataSet ds = new DataSet();
//sqlDa.Fill(ds);
sqlDa.Fill(ds);
//byte[] bytes = (byte[])dt.Rows[0]["clientImages"];
//string base64String = Convert.ToBase64String(bytes, 0, bytes.Length);
//string x = "data:image/png;base64," + base64String;
ClientDataList.DataSource = ds.Tables[0];
ClientDataList.DataBind();
//if (dt.Rows.Count > 0)
//{
// byte[] bytes = (byte[])dt.Rows[0]["clientImages"];
// string base64String = Convert.ToBase64String(bytes, 0, bytes.Length);
// ImageClient.ImageUrl = "data:image/png;base64," + base64String;
// //Where ColumnName is the Field from the DB that you want to display
// lblCompanyName.Text = dt.Rows[0]["clientName"].ToString();
// lblCompanyDescription.Text = dt.Rows[0]["CompanyDescription"].ToString();
// lblCompanyWebUrl.Text = dt.Rows[0]["WebUrl"].ToString();
//}
//connection.Close();
}
private void getDataAddress()
{
DataTable dt = new DataTable();
SqlConnection connection = new SqlConnection(strConnString);
connection.Open();
SqlCommand sqlCmd = new SqlCommand("SELECT * FROM [db_myprofile].[dbo].[myselfprofileAddress] WHERE email='" + Session["EmailId"] + "'", connection);
SqlDataAdapter sqlDa = new SqlDataAdapter(sqlCmd);
//sqlCmd.Parameters.AddWithValue("@username", user);
sqlDa.Fill(dt);
if (dt.Rows.Count > 0)
{
lbladdress.Text = dt.Rows[0]["UserAddress"].ToString();
lblMobileNo.Text = dt.Rows[0]["MobileNumber"].ToString();
lblEmailAddress.Text = dt.Rows[0]["email"].ToString();
//Where ColumnName is the Field from the DB that you want to display
}
connection.Close();
}
}
and this is my designe page
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="myprofile.aspx.cs" Inherits="myprofile" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<meta charset="utf-8">
<title>Home</title>
<link rel="icon" href="images/favicon.ico" />
<link rel="shortcut icon" href="images/favicon.ico" />
<link rel="stylesheet" href="css/style.css" />
<link rel="stylesheet" href="css/camera.css" />
<link rel="stylesheet" href="css/form.css" / >
<script src="js/jquery.js"></script>
<script src="js/jquery-migrate-1.1.1.js"></script>
<script src="js/superfish.js"></script>
<script src="js/forms.js"></script>
<script src="js/jquery.ui.totop.js"></script>
<script src="js/jquery.equalheights.js"></script>
<script src="js/jquery.easing.1.3.js"></script>
<script src="js/jquery.ui.totop.js"></script>
<script src="js/tms-0.4.1.js"></script>
<script>
$(document).ready(function () {
$('.slider_wrapper')._TMS({
show: 0,
pauseOnHover: false,
prevBu: '.prev',
nextBu: '.next',
playBu: false,
duration: 800,
preset: 'fade',
pagination: true,//'.pagination',true,'<ul></ul>'
pagNums: false,
slideshow: 8000,
numStatus: false,
banners: 'fade',
waitBannerAnimation: false,
progressBar: false
});
});
$(document).ready(function () {
!function () {
var map = []
, names = []
, win = $(window)
, header = $('header')
, currClass
$('.content').each(function (n) {
map[n] = this.offsetTop
names[n] = $(this).attr('id')
})
win
.on('scroll', function () {
var i = 0
while (map[i++] <= win.scrollTop());
if (currClass !== names[i - 2])
currClass = names[i - 2]
header.removeAttr("class").addClass(names[i - 2])
})
}();
});
function goToByScroll(id) {
$('html,body').animate({ scrollTop: $("#" + id).offset().top }, 'slow');
}
$(document).ready(function () {
$().UItoTop({ easingType: 'easeOutQuart' });
});
</script>
<!--[if lt IE 8]>
<div style=' clear: both; text-align:center; position: relative;'>
<a href="http://windows.microsoft.com/en-US/internet-explorer/products/ie/home?ocid=ie6_countdown_bannercode">
<img src="http://storage.ie6countdown.com/assets/100/images/banners/warning_bar_0000_us.jpg" border="0" height="42" width="820" alt="You are using an outdated browser. For a faster, safer browsing experience, upgrade for free today." />
</a>
</div>
<![endif]-->
<!--[if lt IE 9]>
<script src="js/html5shiv.js"></script>
<link rel="stylesheet" media="screen" href="css/ie.css">
<![endif]-->
</head>
<body>
<form id="form1" runat="server">
<div>
<!--==============================header=================================-->
<header class="page1">
<div class="container_12">
<div class="grid_12">
<%-- <asp:SqlDataSource ID="SqlDataSourceheaderpic" runat="server"
ConnectionString="<%$ ConnectionStrings:conString %>"
ProviderName="<%$ ConnectionStrings:conString.ProviderName %>"></asp:SqlDataSource>--%>
<%-- <asp:GridView ID="GridView1" DataSourceID="SqlDataSourceheaderpic" runat="server">
<Columns>
<asp:TemplateField HeaderText="Image">
<ItemTemplate>--%>
<h1 style="width: 377px; height: 122px;"><a href="#" onclick="goToByScroll('page1'); return false;" style="width: 377px; height: 122px;">
<asp:Image ID="Image1" runat="server" Height="123px" Width="123px" /></a><asp:Label ID="Label1" runat="server" Text="there is testing deccc"></asp:Label></h1>
<%-- </ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>--%>
<div class="menu_block">
<nav class="">
<ul class="sf-menu">
<li class="current men"><a onclick="goToByScroll('page1'); return false;" href="#">Home </a><strong class="hover"></strong></li>
<li class="men1"><a onclick="goToByScroll('page2'); return false;" href="#">About</a><strong class="hover"></strong></li>
<li class=" men2"><a onclick="goToByScroll('page3'); return false;" href="#">Services</a> <strong class="hover"></strong></li>
<li class=" men3"><a onclick="goToByScroll('page4'); return false;" href="#">Clients</a> <strong class="hover"></strong></li>
<li class=" men4"><a onclick="goToByScroll('page5'); return false;" href="#">Contacts</a> <strong class="hover"></strong></li>
</ul>
</nav>
<div class="clear"></div>
</div>
</div>
<div class="clear"></div>
</div>
</header>
<!--=======content================================-->
<div id="page1" class="content">
<div class="ic">Nicat group templete designe</div>
<div class="container_1" style="margin-left: 174px; background-image:url(<%= Image2.ImageUrl %>)">
<asp:Image ID="Image2" runat="server" Visible="false" Width="960px" Height="400px"/>
<div class="grid_12">
<div class="slider_wrapper">
<ul class="items">
<li>
<img src="images/spacer.gif" alt="" />
<div class="caption banner">
<h2>
<asp:Label ID="lbltextslider1" runat="server" Text=""></asp:Label></h2>
</div>
</li>
<li>
<img src="images/spacer.gif" alt="" />
<div class="caption banner">
<h2><asp:Label ID="lbltextslider2" runat="server" Text=""></asp:Label></h2>
</div>
</li>
<li>
<img src="images/spacer.gif" alt="" />
<div class="caption banner">
<h2><asp:Label ID="lbltextslider3" runat="server" Text=""></asp:Label></h2>
</div>
</li>
<li>
<img src="images/spacer.gif" alt="">
<div class="caption banner">
<h2><asp:Label ID="lbltextslider4" runat="server" Text=""></asp:Label></h2>
</div>
</li>
</ul>
</div>
<div class="socials">
<a href="<%= lblfblink.Text %>" target="_blank">
<asp:Label ID="lblfblink" runat="server" Text=""></asp:Label></a>
<a href="<%= lblTwitter.Text %>" target="_blank">
<asp:Label ID="lblTwitter" runat="server" Text=""></asp:Label>
</a>
<a href="<%= lblGooglepluse.Text %>" target="_blank">
<asp:Label ID="lblGooglepluse" runat="server" Text=""></asp:Label>
</a>
<a href="<%= lbllinkedin.Text %>">
<asp:Label ID="lbllinkedin" runat="server" Text=""></asp:Label>
</a>
</div>
</div>
</div>
</div>
<div id="page2" class="content">
<div class="container_12">
<div class="grid_12">
<div class="slogan">
<h3>About Us</h3>
<div class="text1">
<div align="justify" class="text1">
<asp:Label ID="lblboutUs" runat="server" Text=""></asp:Label>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="page3" class="content">
<div class="container_12">
<div class="grid_12">
<div class="slogan">
<h3>
<asp:Label ID="lblheader" runat="server"></asp:Label>
</h3>
<div class="text1">
</div>
</div>
</div>
<div class="grid_3">
<div class="box maxheight1">
<%--<img src="images/box1_img1.png" alt="" />--%>
<div style="background-color: black; height: 150px; width: 150px; border-style: solid;border-width: 4px 3px; border-color: #fff; text-align: center;line-height:30px; display:inline-block;-moz-border-bottom-colors: none; -moz-border-left-colors: none; -moz-border-right-colors: none; -moz-border-top-colors: none; border-radius: 100%;">
</br><strong><asp:Label ID="lblserviceone" Font-Size="Medium" runat="server"></asp:Label></strong>
</div>
<div class="text1"><a href="#">Work</a></div>
<asp:Label ID="lblserviceonedec" runat="server"></asp:Label>
</div>
</div>
<div class="grid_3">
<div class="box maxheight1">
<%--<img src="images/box1_img2.png" alt="">--%>
<div style="background-color: black; height: 150px; width: 150px; border-style: solid;border-width: 4px 3px; border-color: #fff; text-align: center;line-height:50px; vertical-align:middle; display:inline-block;-moz-border-bottom-colors: none; -moz-border-left-colors: none; -moz-border-right-colors: none; -moz-border-top-colors: none; border-radius: 100%;">
</br><strong><asp:Label ID="lblservicesecond" Font-Size="Medium" runat="server"></asp:Label></strong>
</div>
<div class="text1"><a href="#">Work</a></div>
<asp:Label ID="lblserviceseconddec" runat="server"></asp:Label>
</div>
</div>
<div class="grid_3">
<div class="box maxheight1">
<%--<img src="images/box1_img3.png" alt="">--%>
<div style="background-color: black; height: 150px; width: 150px; border-style: solid;border-width: 4px 3px; border-color: #fff; text-align: center;line-height:50px; vertical-align:middle; display:inline-block;-moz-border-bottom-colors: none; -moz-border-left-colors: none; -moz-border-right-colors: none; -moz-border-top-colors: none; border-radius: 100%;">
</br><strong><asp:Label ID="lblservicethird" Font-Size="Medium" runat="server"></asp:Label></strong>
</div>
<div class="text1"><a href="#">Work</a></div>
<asp:Label ID="lblservicethirddec" runat="server"></asp:Label>
</div>
</div>
<div class="grid_3">
<div class="box maxheight1">
<%--<img src="images/box1_img4.png" alt="">--%>
<div style="background-color: black; height: 150px; width: 150px; border-style: solid;border-width: 4px 3px; border-color: #fff; text-align: center;line-height:50px; vertical-align:middle; display:inline-block;-moz-border-bottom-colors: none; -moz-border-left-colors: none; -moz-border-right-colors: none; -moz-border-top-colors: none; border-radius: 100%;">
</br><strong><asp:Label ID="lblservicefourth" Font-Size="Medium" runat="server"></asp:Label></strong>
</div>
<div class="text1"><a href="#">Work</a></div>
<asp:Label ID="lblservicefourthdec" runat="server"></asp:Label>
</div>
</div>
</div>
</div>
<div id="page4" class="content">
<div class="container_12">
<div class="grid_12">
<h3>Our Clients</h3>
</div>
<asp:DataList ID="ClientDataList" runat="server"
Font-Names="Cambria" RepeatColumns="4"
RepeatDirection="Horizontal" Width="100%">
<ItemTemplate>
<div class="companies">
<div class="grid_3">
<asp:Image ID="imgEmp" runat="server" Width="220px" Height="98px" ImageUrl='<%# "GetClientImages.aspx?id=" + Eval("myprifileclientId") %>' style="padding-left:40px"/>
<div class="text1"><asp:Label ID="lblCompanyName" runat="server" Text='<%# Bind("clientName") %>'></asp:Label></div>
<asp:Label ID="lblCompanyDescription" runat="server" Text='<%# Bind("CompanyDescription") %>'></asp:Label>
<br>
<a href="#">Go to Site<asp:Label ID="lblCompanyWebUrl" runat="server" Text='<%# Bind("WebUrl") %>'></asp:Label></a>
</div>
<%--<div class="grid_3">
<img src="images/logo2.jpg" alt="">
<div class="text1">Company Name</div>Fusce adipiscing quam id risus gittis, non consequat lacus interdumoin.
<br>
<a href="#">Go to Site</a>
</div>--%>
<%--<div class="grid_3">
<img src="images/logo3.jpg" alt="">
<div class="text1">Company Name</div>Quisque viverra nulla nunc, eu ultrices wertlibero ultricies egetasellus um.
<br>
<a href="#">Go to Site</a>
</div>--%>
<%--<div class="grid_3">
<img src="images/logo4.jpg" alt="">
<div class="text1">Company Name</div>Courrewerwe abitur vel lorem sit amet ulla ullamcorper fermentumn vitae.
<br>
<a href="#">Go to Site</a>
</div>--%>
<div class="clear"></div>
<%--<div class="grid_3">
<img src="images/logo5.jpg" alt="">
<div class="text1">Company Name</div>Oiliquam nibh ante, egestas id dictum wrecommodo luctus liberoaesente.
<br>
<a href="#">Go to Site</a>
</div>--%>
<%--<div class="grid_3">
<img src="images/logo6.jpg" alt="">
<div class="text1">Company Name</div>Gusce adipiscing quam id risus gittis, non consequat lacus interdumoiju.
<br>
<a href="#">Go to Site</a>
</div>--%>
<%--<div class="grid_3">
<img src="images/logo7.jpg" alt="">
<div class="text1">Company Name</div>Niuisque viverra nulla nunc, eu ultrices wertlibero ultricies egetasellus ol.
<br>
<a href="#">Go to Site</a>
</div>--%>
<%--<div class="grid_3">
<img src="images/logo8.jpg" alt="">
<div class="text1">Company Name</div>Fouerourrewerwe abitur vel lorem sit amet ulla ullamcorper fermentum.
<br>
<a href="#">Go to Site</a>
</div>--%>
</div>
</ItemTemplate>
</asp:DataList>
</div>
</div>
<div id="page5" class="content">
<div class="container_12">
<div class="grid_12">
<div class="slogan">
<h3>Get in Touch</h3>
<div class="text1">
For Further Information
</div>
</div>
</div>
<div class="clear"></div>
<div class="map">
<div class="grid_3" style="width: 478px; border:#FFFFFF 2px groove; background-color:#eda814;margin-left: 10px;">
<div class="text1" style="text-decoration-color:blueviolet;margin-left: 14px;"><strong>OFFICE ADDRESS</strong></div>
<address style="margin-left: 14px;">
<%--<dl>--%>
<asp:Label ID="lbladdress" runat="server" Text=""></asp:Label>
<span>Mobile No:</span><asp:Label ID="lblMobileNo" runat="server" Text=""></asp:Label>
E-mail: <a href="#" class="link-1"><p style="height: 10px;padding-top:-1px;"><asp:Label ID="lblEmailAddress" runat="server" Text=""></asp:Label></p></a>
<%--</dl>--%>
</address>
</div>
<div class="grid_3" style="border:#FFFFFF 2px groove; height: 228px; margin-left:224px;">
<div class="text1"> </div>
<figure class=" "; style="margin-left: 0px; margin-top: -61px; border:2px #FFFFFF thin">
<iframe src="http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=Brooklyn,+New+York,+NY,+United+States&aq=0&sll=37.0625,-95.677068&sspn=61.282355,146.513672&ie=UTF8&hq=&hnear=Brooklyn,+Kings,+New+York&ll=40.649974,-73.950005&spn=0.01628,0.025663&z=14&iwloc=A&output=embed"></iframe>
</figure>
</div>
<!--<div class="grid_5 prefix_1">
<div class="text1">Book Demo / Complaint</div>
<form id="form">
<div class="success_wrapper">
<div class="success"><br>
<strong>We will be in touch soon.</strong> </div></div>
<fieldset>
<label class="name">
<input type="text" value="Name:">
<br class="clear">
<span class="error error-empty">*This is not a valid name.</span><span class="empty error-empty">*This field is required.</span> </label>
<label class="email">
<input type="text" value="E-mail:">
<br class="clear">
<span class="error error-empty">*This is not a valid email address.</span><span class="empty error-empty">*This field is required.</span> </label>
<label class="message">
<textarea>Message:</textarea>
<br class="clear">
<span class="error">*The message is too short.</span> <span class="empty">*This field is required.</span> </label>
<div class="clear"></div>
<div class="btns"><a data-type="submit" class="link1">Send</a>
<div class="clear"></div>
</div></fieldset></form>
</div> -->
<div class="clear"></div>
</div>
</div>
</div>
<!--==============================footer=================================-->
<footer>
<div class="container_12">
<div class="grid_12">
<div class="copy">
<a onClick="goToByScroll('page1'); return false;" href="#"><asp:Image ID="footerimg" runat="server" Width="56px" Height="23px" alt=""/></a> © 2015 | <a href="#">Privacy Policy</a> <br> Website designed by <a href="#" rel="nofollow">nicatgroup.com</a>
</div>
</div>
<div class="clear"></div>
</div>
</footer>
</div>
</form>
</body>
</html>
and this is my globle page
<%@ Application Language="C#" %>
<%@ Import Namespace="System.Web.Routing" %>
<script runat="server">
void Application_Start(object sender, EventArgs e)
{
RegisterRoutes(RouteTable.Routes);
}
static void RegisterRoutes(RouteCollection routes)
{
routes.MapPageRoute("WebUrl", "WebUrl", "~/myprofile.aspx=WebUrl");
}
void Application_End(object sender, EventArgs e)
{
// Code that runs on application shutdown
}
void Application_Error(object sender, EventArgs e)
{
// Code that runs when an unhandled error occurs
}
void Session_Start(object sender, EventArgs e)
{
// Code that runs when a new session is started
}
void Session_End(object sender, EventArgs e)
{
// Code that runs when a session ends.
// Note: The Session_End event is raised only when the sessionstate mode
// is set to InProc in the Web.config file. If session mode is set to StateServer
// or SQLServer, the event is not raised.
}
</script>
and now i want to open my selprofile page directly entered by url
http://localhost:6204/manish
please help me