|
Can anyone give me sample of code using QuerString (e.g passing ang retriving value)
A key to every Solution
|
|
|
|
|
URL: www.somewhere.com/test.aspx?name=bob
Code:
string theName;
theName = Request.Querystring("name");
Response.Write(theName);
|
|
|
|
|
Hi,
you can set multiple QueryString
<br />
string tempURL = "~/MySite.com/Welcome.aspx?Name=" +MyName+ "&Surname="+MySurname;<br />
Now on Welcome.aspx page you can get this both values like this.
<br />
if(Request.QueryString.Count>0)<br />
{<br />
if(Request.QueryString["Name"].ToString()!=null)<br />
{<br />
Name= Request.QueryString["Name"];<br />
}<br />
if(Request.QueryString["MySurname"].ToString()!=null)<br />
{<br />
MySurname = Request.QueryString["MySurname"];<br />
}<br />
}<br />
Regards...
|
|
|
|
|
hi all
I try to connect to file DBF in ASP.net
this my code:
if(File.Exists(@"C:\demo\AAAdddddd.dbf"))
{
string strQuery = @"SELECT * FROM C:\demo\AAAdddddd.dbf WHERE 1=0";
string strConnectionDbf = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\demo\;Extended Properties=dBASE IV;User ID=Admin;Password=;";
OleDbConnection connect = new OleDbConnection(strConnectionDbf);
connect.Open();
OleDbDataAdapter da = new OleDbDataAdapter(strQuery, connect);
DataTable dtCol = new DataTable();
da.Fill(dtCol);
}
but i see problem
The Microsoft Jet database engine could not find the object 'AAAdddddd.dbf'. Make sure the object exists and that you spell its name and the path name correctly.
but i change name file to AAA.dbf and change strQuery = @"SELECT * FROM C:\demo\AAA.dbf WHERE 1=0";
so it run good
I dont understant. May be oledb connect to dbf file depend to name file ????
And I try many again but still error
and i am extraordinary when check file exist it still = true; ???????????
Some body show for me Why ???
|
|
|
|
|
what are private classes in .net
|
|
|
|
|
A class declared with the privat keyword.
<br />
private class MyClass<br />
{<br />
}<br />
|
|
|
|
|
Even I dont know.
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
Sheena wrote: what are private classes in .net
They would initially seem to be a bit pointless, but they have their uses. They are classes that can be nested within another class. They are private to the class they are nested within and cannot be used externally because they are private.
e.g.
public class OuterClass
{
private class InnerClass
{
}
}
In the above example, nothing outside of the OuterClass can see the InnerClass.
|
|
|
|
|
Thanks !
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
How a column value in a table is set null.If the column is null no execution is done for the query.
|
|
|
|
|
SreejithAchutan wrote: How a column value in a table is set null.
Update Table name set columm = null..
|
|
|
|
|
Hi,
How can i get my Stored procedure result in Aspx page.I have one strode procedure to insert records,if record is existed in the data base with same ID,then i need to show a message like 'Record all ready existed'.
Vasvai
|
|
|
|
|
You need to add an output parameter and decide upon what value you will return in case if record exists.
So you may return some int value to represent that record exists for example - 1000 otherwise, if record does not exists you may return 500.
Something like that.
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
Using Output parameter in Stored procedure we can do this.
Search in google for Output Parameter.
Thanks & Regards
Niranjan
|
|
|
|
|
I am working on a jobsite project.When a user upload his resume it is saved as a document file in a folder.My requiremnt is when the user wants to edit his/her profile his resume should be opened and displayed to him as he/she uploaded it with all formatted text.I im able to locate and open the file but i am notable to show it in a formatted way to the user.
the code written by me is:
Dim strContents As String
Dim objReader As StreamReader
objReader = New StreamReader(Server.MapPath("Resume\") & filepath)
strContents = objReader.ReadToEnd()
objReader.Close()
lbl_ResumeDetail.Text = strContents
filepath is a string variable in which i am accessing the filename from the database.
Your help in this regard will be highly beneficial and awaited.
Madhulika Agarwal.
|
|
|
|
|
which allows you to upload the file format?
my english is very bad!
|
|
|
|
|
I am trying to add controls to a web part dynamically.The controls are getting added but their values are not getting populated.Eg: If i try adding a textbox with some text specified, then the textbox is getting added but the text is not getting populated. But the same control is getting rendered with all the appropriate text on the form.
|
|
|
|
|
ASP.NET Javascript Calander Contol You have easly create to webform..
I have given to code from here. Please read and following on Steps
Step 1: First You will create "Cal.js" from Javascripts file..
Step 2: Next You will create "Cal.css" from Style sheet file..
Step 3: after you will create from "Cal.ascx" in you ASP.NET User Contorl..
Step 4: Finally you have create from "Cal.aspx" in you ASP.NET WebForm..
Step 1:
First you have create one Javascript and save from "cal.js"
<br />
<br />
<br />
<br />
var months = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");<br />
var daysInMonth = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);<br />
var days = new Array("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat");<br />
var monthsArr = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");<br />
<br />
today = new getToday(); <br />
var element_id;<br />
<br />
<br />
function getDays(month, year) <br />
{<br />
if (1 == month)<br />
return ((0 == year % 4) && (0 != (year % 100))) ||<br />
(0 == year % 400) ? 29 : 28;<br />
else<br />
return daysInMonth[month];<br />
}<br />
<br />
function getToday()<br />
{<br />
this.now = new Date();<br />
this.year = this.now.getFullYear() ;
this.month = this.now.getMonth();<br />
this.day = this.now.getDate();<br />
}<br />
<br />
<br />
function newCalendar() <br />
{<br />
var parseYear = parseInt(document.all.year [document.all.year.selectedIndex].text);<br />
<br />
var newCal = new Date(parseYear , document.all.month.selectedIndex, 1);<br />
var day = -1;<br />
var startDay = newCal.getDay();<br />
var daily = 0; <br />
<br />
today = new getToday();
if ((today.year == newCal.getFullYear() ) && (today.month == newCal.getMonth()))<br />
day = today.day;<br />
var tableCal = document.all.calendar.tBodies.dayList;<br />
<br />
var intDaysInMonth =<br />
getDays(newCal.getMonth(), newCal.getFullYear() );<br />
<br />
for (var intWeek = 0; intWeek < tableCal.rows.length; intWeek++)<br />
for (var intDay = 0;<br />
intDay < tableCal.rows[intWeek].cells.length;<br />
intDay++)<br />
{<br />
var cell = tableCal.rows[intWeek].cells[intDay];<br />
<br />
<br />
<br />
if ((intDay == startDay) && (0 == daily))<br />
daily = 1;<br />
<br />
cell.style.color = (day == daily) ? "red" : "";<br />
<br />
<br />
var newDate = new Date().getDate();<br />
if(today.day == daily)<br />
cell.style.color = "red";<br />
if(day == daily)<br />
{<br />
document.all.todayday.innerText= "Today: " + day + "/" + <br />
(newCal.getMonth()+1) + "/" + newCal.getFullYear() ;<br />
}<br />
if ((daily > 0) && (daily <= intDaysInMonth))<br />
cell.innerText = daily++;<br />
else<br />
cell.innerText = "";<br />
<br />
if(intDay ==0 || intDay ==6)<br />
cell.style.backgroundColor = "#C0C0C0";<br />
}<br />
<br />
}<br />
<br />
function getTodayDay()<br />
{<br />
<br />
document.all[element_id].value = today.day + "/" + (monthsArr[today.month]) + <br />
"/" + today.year; <br />
document.all.calendar.style.display="none";<br />
document.all.month.selectedIndex = today.month; <br />
<br />
}<br />
<br />
function getDate() <br />
{<br />
if ("TD" == event.srcElement.tagName)<br />
if ("" != event.srcElement.innerText)<br />
{ <br />
var Year = document.all.year [document.all.year.selectedIndex].text;<br />
document.all[element_id].value=event.srcElement.innerText+"/"+monthsArr[document.all.month.selectedIndex] +"/" +Year;<br />
document.all.calendar.style.display="none";<br />
}<br />
}<br />
<br />
function getDateMouseOver() <br />
{<br />
if ("TD" == event.srcElement.tagName)<br />
if ("" != event.srcElement.innerText)<br />
{ <br />
var Year = document.all.year [document.all.year.selectedIndex].text;<br />
document.all[element_id].value=event.srcElement.innerText+"/"+monthsArr[document.all.month.selectedIndex] +"/" +Year;<br />
<br />
if (today.day == event.srcElement.innerHTML)<br />
event.srcElement.style.color="red";<br />
else<br />
event.srcElement.style.color="blue";<br />
<br />
<br />
}<br />
}<br />
<br />
var MOUSE_OVER_COLOR = "BLUE";<br />
var MOUSE_OUT_COLOR = "BLACK";<br />
var TODAY_DATE_COLOR = "RED";<br />
<br />
function getDateMouseOut() <br />
{<br />
if ("TD" == event.srcElement.tagName)<br />
if ("" != event.srcElement.innerText)<br />
{ <br />
var mn = document.all.month.selectedIndex+1;<br />
var Year = document.all.year [document.all.year.selectedIndex].text;<br />
document.all[element_id].value=event.srcElement.innerText+"/"+monthsArr[document.all.month.selectedIndex] +"/" +Year;<br />
if (today.day == event.srcElement.innerHTML)<br />
event.srcElement.style.color="red";<br />
else<br />
event.srcElement.style.color="black";<br />
}<br />
}<br />
<br />
function GetBodyOffsetX(el_name, shift)<br />
{<br />
var x;<br />
var y;<br />
x = 0;<br />
y = 0;<br />
<br />
var elem = document.all[el_name];<br />
do <br />
{<br />
x += elem.offsetLeft;<br />
y += elem.offsetTop;<br />
if (elem.tagName == "BODY")<br />
break;<br />
elem = elem.offsetParent; <br />
} while (1 > 0);<br />
<br />
shift[0] = x;<br />
shift[1] = y;<br />
return x;<br />
} <br />
<br />
function SetCalendarOnElement(el_name)<br />
{<br />
if (el_name=="") <br />
el_name = element_id;<br />
var shift = new Array(2);<br />
GetBodyOffsetX(el_name, shift);<br />
document.all.calendar.style.pixelLeft = shift[0];
document.all.calendar.style.pixelTop = shift[1] + 25 ;<br />
}<br />
<br />
<br />
<br />
function ShowCalendar(elem_name)<br />
{<br />
if (elem_name=="")<br />
elem_name = element_id;<br />
<br />
element_id = elem_name;
newCalendar();<br />
SetCalendarOnElement(element_id);<br />
document.all.calendar.style.display="inline";<br />
}<br />
<br />
function HideCalendar()<br />
{<br />
document.all.calendar.style.display="none";<br />
}<br />
function PreviewMonth()<br />
{<br />
var monthpNumber = document.all.month.selectedIndex - 1;<br />
if (monthpNumber == 0 )<br />
document.all.month.selectedIndex = 11;<br />
else<br />
document.all.month.selectedIndex = document.all.month.selectedIndex - 1;<br />
newCalendar();<br />
}<br />
function NextMonth()<br />
{<br />
var monthnNumber = document.all.month.selectedIndex + 1;<br />
if (monthnNumber == 12 )<br />
document.all.month.selectedIndex = 0;<br />
else<br />
document.all.month.selectedIndex = document.all.month.selectedIndex + 1;<br />
if(document.all.month.selectedIndex == 0)<br />
document.all.year.selectedIndex = document.all.year.selectedIndex + 1;<br />
newCalendar();<br />
}<br />
<br />
function toggleCalendar(elem_name)<br />
{<br />
if(document.all.calendar.style.display=="none")<br />
ShowCalendar(elem_name);<br />
else <br />
HideCalendar();<br />
}<br />
<br />
function compareDateWithToday(selectedDate,message,dateSeperator){ <br />
var currentTime = new Date()<br />
var month1,date1,year1;<br />
var firstIndex = selectedDate.indexOf (dateSeperator);<br />
var lastIndex = selectedDate.lastIndexOf (dateSeperator);<br />
var result = true;<br />
<br />
date1 = selectedDate.substring (0, firstIndex);<br />
month1 = selectedDate.substring (firstIndex+1, lastIndex);<br />
year1 = selectedDate.substring (lastIndex+1, selectedDate.length); <br />
<br />
<br />
if(parseInt(currentTime.getFullYear())<parseInt(year1))<br />
result = false;<br />
if(parseInt(currentTime.getMonth())<parseInt(getMonthIndex(month1,monthsArr)))<br />
result = false;<br />
if(parseInt(currentTime.getDate())<parseInt(date1))<br />
result = false;<br />
if(!result)<br />
alert(message);<br />
return result;<br />
}<br />
<br />
function getMonthIndex(monthName,monthArray){<br />
for(var i=0;i<monthArray.length;i++){<br />
if(monthName == monthArray[i])<br />
return i;<br />
}<br />
}<br />
<br />
Step 2
Second you have create Style Sheet and save on "Cal.css"
<br />
.tabelbody {<br />
BORDER-RIGHT: #000000 1px; <br />
BORDER-TOP: #000000 1px; <br />
DISPLAY:none;<br />
Z-INDEX: 4; <br />
BORDER-LEFT: #000000 1px; <br />
BORDER-BOTTOM: #000000 1px; <br />
POSITION: absolute; <br />
BACKGROUND-COLOR: #cccccc;<br />
text-align: center<br />
}<br />
<br />
.header {<br />
FONT-FAMILY: Arial; <br />
TEXT-ALIGN: center;<br />
FONT-SIZE: 85%;<br />
COLOR: #FFFFFF;<br />
}<br />
.hyperlinktext {<br />
color: #FFFFFF;<br />
FONT-SIZE: 70%;<br />
text-align: center<br />
}<br />
.todayday {<br />
FONT-SIZE: 75%;<br />
COLOR:White; <br />
font-family:Arial;<br />
}<br />
.month {<br />
FONT-SIZE: 110%;<br />
COLOR: #FFFFFF; <br />
text-align: center;<br />
}<br />
.intdays {<br />
FONT-SIZE: 70%;<br />
font-family:Arial;<br />
COLOR: #627573; <br />
BACKGROUND-COLOR: #D3D3D1;<br />
text-align: center;<br />
}<br />
.week {<br />
FONT-SIZE: 70%;<br />
font-family:Arial;<br />
text-align: center;<br />
}<br />
.TrbgGraycolor {<br />
BACKGROUND-COLOR:Gray;<br />
}<br />
.TrbgDarkGraycolor {<br />
BACKGROUND-COLOR:DarkGray;<br />
}<br />
Step 3
Third you have create from UserControl and save on "cal.ascx"
<br />
<TABLE border="0" class="tabelbody" cellPadding="1" cellSpacing="0" id="calendar" ><br />
<TBODY><br />
<tr class="TrbgDarkGraycolor"><br />
<td colspan="7" class="header">Calendar</td><br />
</tr><br />
<TR class="TrbgGraycolor"><br />
<td onclick="javascript:PreviewMonth();" class="month"><</td><br />
<TD colSpan="5" valign="middle"><br />
<!-- Month combo box --><br />
<SELECT id="month" onchange="newCalendar()"><br />
<SCRIPT language="JavaScript"><br />
for (var intLoop = 0; intLoop < months.length; intLoop++)<br />
document.write("<OPTION " + (today.month == intLoop ? "Selected" : "") + ">" + months[intLoop]);<br />
</SCRIPT><br />
</SELECT><br />
<!-- Year combo box --><br />
<SELECT id="year" onchange="newCalendar()"><br />
<SCRIPT language="JavaScript"><br />
for (var intLoop = 1900; intLoop < 2028; intLoop++)<br />
document.write("<OPTION " + (today.year == intLoop ? "Selected" : "") + ">" + intLoop);<br />
</SCRIPT><br />
</SELECT><br />
</TD><br />
<td onclick="javascript:NextMonth();" class="month">></td><br />
</TR><br />
<TR class="days"><br />
<!-- Generate column for each day. --><br />
<SCRIPT language="JavaScript"><br />
for (var intLoop = 0; intLoop < days.length; intLoop++)<br />
document.write("<TD class='intdays'>" + days[intLoop] + "</TD>");<br />
</SCRIPT><br />
</TR></tbody><br />
<TBODY id="dayList" onclick="getDate('');" onmouseover="getDateMouseOver('');" onmouseout="getDateMouseOut('');"<br />
vAlign="middle"><br />
<!-- Generate grid for individual days. --><br />
<SCRIPT language="JavaScript"><br />
for (var intWeeks = 0; intWeeks < 6; intWeeks++)<br />
{<br />
document.write("<TR bgColor=#fffffg> ");<br />
for (var intDays = 0; intDays < days.length; intDays++)<br />
document.write('<TD class="week"></TD>');<br />
document.write("</TR>");<br />
}<br />
</SCRIPT><br />
<!-- Generate today day. --><br />
</TBODY><br />
<TBODY align="center"><br />
<TR class="TrbgGraycolor" align="center"><br />
<TD class="todayday" colSpan="5" id="todayday" onclick="getTodayDay();"><br />
</TD><br />
<TD colSpan="2" align="center"><A href="javascript:HideCalendar();" class="hyperlinktext">Hide</A></TD><br />
</TR><br />
</TBODY><br />
</TABLE><br />
<br />
Step 4:
Finally you have add from your web form on "Cal.aspx"
<br />
<br />
<HTML><br />
<%@ Register TagPrefix="uc11" TagName="cal" Src="cal.ascx" %><br />
<HEAD><br />
<LINK href="cal.css" type="text/css" rel="stylesheet"><br />
<script src="cal.js" type="text/javascript"></script><br />
</HEAD><br />
<br />
<body><br />
<form id="Form1" method="post" runat="server"><br />
<uc11:cal id="cal1" runat="server"></uc11:cal><br />
<br />
<br />
<TABLE id="Table3" cellSpacing="0" cellPadding="0" width="100%" border="0"><br />
<TR><br />
<TD style="HEIGHT: 59px"><br />
<asp:textbox id="txt_box" runat="server" Width="145px" Height="26px" Font-Names="Arial"<br />
Font-Size="X-Small" MaxLength="50"></asp:textbox><A onmouseover="toggleCalendar('txt_box')" href="JavaScript:;"></A></TD><br />
</TR><br />
<br />
</TR><br />
</TABLE><br />
<br />
</HTML><br />
<br />
<br />
S.RajaLingam
modified on Friday, December 07, 2007 4:54:45 AM
|
|
|
|
|
Fascinating.
Did you forget to ask a question?
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
maybe he or she is a churchman ?haha
my english is very bad!
|
|
|
|
|
Looks to me like somebody is trying to store snippets in CodeProject.
|
|
|
|
|
Hello can any body help me to find how to check whther my website name is exist in other website or not. for example my site name is www.abc.com and I want to find my URL address (http://www.abc.com) in other websites. So can anybody tell me how can I find my url name in other sites. Thanks in advance
|
|
|
|
|
I guess I have already answered this long back. You need to look into HttpWebRequest and HttpWebResponse classes. Give a request to the target website and get a reponse. Write a regular expression to find your website name, and look in the response string.
|
|
|
|
|
You need to look into HttpWebRequest and HttpWebResponse classes. Give a request to the target website and get a reponse. Write a regular expression to this to find your website name is avble or not , and look in the response string.
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|