|
Take a look at this article.
Regards,
--Perspx
"I've got my kids brainwashed: You don't use Google, and you don't use an iPod." - Steve Ballmer
"Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen an angry penguin charging at them in excess of 100mph." - Linus Torvalds
|
|
|
|
|
We are using session value in other pages but when control going in any page in catch block then sesion is getting expired but still we need session value.
So please can any one help me to solve this problem.
Session must not be expired any how.
thanks
You get the best out of others when you give the best of yourself.
|
|
|
|
|
trilokharry wrote: You get the best out of others when you give the best of yourself.
You could get a good answer if you knew how to explain your problem
Alexei Rodriguez
|
|
|
|
|
Does anybody know whats the means of this code in script:
"if (confirm('Are you sure?')){{{0}}}"
|
|
|
|
|
I think it's bracket art. If you stare at it long enough, you'll be hypnotized into thinking it does something.
Seriously, that code does nothing, besides showing dialog asking if you are sure.
- S
50 cups of coffee and you know it's on!
A post a day, keeps the white coats away!
|
|
|
|
|
i have a button and i want when i clicked it i show a confirm box and ask me that i sure to save or not if i click ok it save and if i click cancel it dont to be save. but i dont know how should i call button_click() if i push ok. can any body help me plz???? i wrote this code:
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "test1", "function confirm_entry(){input_box=confirm(\"Click OK or Cancel to Continue\");if (input_box==true){ ?????;}else{ ????;}}", true);
btnAccept.Attributes.Add("onclick", "confirm_entry();");
modified on Sunday, September 28, 2008 1:13 AM
|
|
|
|
|
Look at this example to confirm de deletion of a record:
<asp:ImageButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Delete"
OnClientClick="return confirm('Delete record?');"
ImageUrl="~/img/delete.png" />
If the users chooses canel, no postback is fired, otherwise, a postback will occur
Alexei Rodriguez
|
|
|
|
|
how to upload a file
using below i can save the file to "UploadedFiles" folder.
<br />
Dim path As String = Server.MapPath("~/UploadedFiles/")<br />
however, i want to save the file to a folder in "UploadedFiles".
for instance if currently login user name is "mark" then save the file into UploadedFiles/mark/
I tried this but it doesn't work
<br />
Dim path As String = Server.MapPath("~/UploadedFiles/" & Session("CurrentlyLogedinUserName"))<br />
|
|
|
|
|
Be more clear about what is not working...
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
thanks for replying.
now i can upload files to currently login user's folder.
<br />
Dim path As String = Server.MapPath("~/UploadedFiles/" & Session("CurrentlyLogedinUserName") & "/")<br />
|
|
|
|
|
Glad you fixed it, man. I should have noticed the lack of "/" at the end
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Hello friends,
I am using Sql server 2005 reporting services. I have designed report and created datasource. Now I want to upload it to my project. But I dont know how to upload this files and where to upload ? Please help me...
thanks..
|
|
|
|
|
Hello
I work with a master page and content page
i try to find a Button in my content page, where i want to write my code behind
because i get the ID of this Button from the database
so any help will be greatly appreciated
Thanks in advance
Assaf
|
|
|
|
|
Where is the control located which you are trying to find... In master or in content page...?
In case, the control is located in master page then use
Button btn = Master.FindControl("<control-id>") as Button;
replace <control-id> with the id of the button fetched from database.
|
|
|
|
|
the control is located in content page
Thanks in advance
Assaf
|
|
|
|
|
hi
i have a link button in datagrid control. and on run time linkbutton text is C:\Documents and Settings\rohit\Desktop\PMS\Data1\processing1.rar file. now i would like to save this file on mycomputer.
I will do my best?
Integrated Solutions, Bikaner (Raj.), India
|
|
|
|
|
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
You cannot access the files not in IIS path using a web application.
|
|
|
|
|
hi, I have a website that is hosted on iis 6.0 and it's domain name www.mywebsite.com
The virtual directory folder has anonymous access enabled and also integrated windows authentication checked also.
When a user writes www.mywebsite.com in his browser, a prompt for user credentials is displayed but if he writes www.mywebsite.com/login.aspx, it doesn't ask for any user credentials. I want to know how can I fix this. 3 months ago it was working fine. I don't what happened.
Note: recently the site owner registered a new domain www.mywebsite2.com that points to www.mywebsite.com so if a user writes www.mywerbsite2.com, it redirects to www.mywebsite.com.
Could this be the issue or what?
I don't want this prompt to appear when the user writes www.website.com.
Can someone help?
Thanks
|
|
|
|
|
hi,
how to use querystring.
how to set and get query string.
I will do my best?
Integrated Solutions, Bikaner (Raj.), India
|
|
|
|
|
hello...
you can set a query string by padding it to the url you want your user to be redirected to for example
at page 1
=========
<br />
void button1_click (object sender , EventArgs e)<br />
{<br />
Response.Redirect("page2.aspx?username="+textbox1.text+"&password="+textbox2.text);<br />
}<br />
now at page2
===========
you can access those query string data by accessing the query string request at the page2 as follows
at page 2
========
<br />
void Page_Load(object sender , EventArgs e)<br />
{<br />
if(Request.QueryString["username"] != null && Request.QueryString["password"] != null)<br />
{<br />
string username = Request.QueryString["usename"];<br />
string password = Request.QueryString["password"];<br />
}<br />
<br />
}<br />
Human knowledge belongs to the world.
|
|
|
|
|
<br />
Dim CurrentMaxDocumentIDForASpecificUser As Integer<br />
<br />
Private Sub GetMaxDocumentIDForASpecificUser()<br />
<br />
Dim Get_MaxDocumentIDForASpecificUser_StrSQL As String<br />
Dim Get_MaxDocumentIDForASpecificUser_ObjCmd As SqlCommand<br />
<br />
<br />
Dim strConn As String = ConfigurationManager.ConnectionStrings("HomeConnectionString").ToString()<br />
<br />
Dim MyCon As SqlConnection<br />
MyCon = New SqlConnection(strConn)<br />
<br />
Get_MaxDocumentIDForASpecificUser_StrSQL = "Select max(DocumentID) from UploadedDocuments where Owner='" & Trim(Session("CurrentlyLogedinUserName")) & "'"<br />
<br />
MyCon.Open()<br />
<br />
Get_MaxDocumentIDForASpecificUser_ObjCmd = New SqlCommand(Get_MaxDocumentIDForASpecificUser_StrSQL, MyCon)<br />
<br />
CurrentMaxDocumentIDForASpecificUser = Get_MaxDocumentIDForASpecificUser_ObjCmd.ExecuteScalar<br />
<br />
MyCon.Close()<br />
<br />
End Sub<br />
when i run this code for the very first time(when db table is empty)i am getting the following eror:
Conversion from type 'DBNull' to type 'Integer' is not valid.
how can i check this for null?
|
|
|
|
|
my friend you set that variable as integer
<br />
Dim CurrentMaxDocumentIDForASpecificUser As Integer<br />
and then run your sql command to retrieve the last inserted row
in the database and return that to you as object because ExecuteScalar() return only one record casted within type object
so if you want to check if that ExecuteScalar will return that record or there is no any records returned that is so easy
cast the return value of the ExecuteScalar to an integer and check it
<br />
Dim CurrentMaxDocumentIDForASpecificUser As Integer<br />
<br />
CurrentMaxDocumentIDForASpecificUser = (int)SqlCommand.ExecuteScalar();<br />
<br />
if(CurrentMaxDocumentIDForASpecificUser > 0)<br />
else<br />
Human knowledge belongs to the world.
|
|
|
|
|
<br />
Private Sub GetMaxDocumentIDForASpecificUser()<br />
<br />
Dim Get_MaxDocumentIDForASpecificUser_StrSQL As String<br />
Dim Get_MaxDocumentIDForASpecificUser_ObjCmd As SqlCommand<br />
<br />
<br />
Dim strConn As String = ConfigurationManager.ConnectionStrings("HomeConnectionString").ToString()<br />
<br />
Dim MyCon As SqlConnection<br />
MyCon = New SqlConnection(strConn)<br />
<br />
Get_MaxDocumentIDForASpecificUser_StrSQL = "Select max(DocumentID) from UploadedDocuments where Owner='" & Trim(Session("CurrentlyLogedinUserName")) & "'"<br />
<br />
MyCon.Open()<br />
<br />
Get_MaxDocumentIDForASpecificUser_ObjCmd = New SqlCommand(Get_MaxDocumentIDForASpecificUser_StrSQL, MyCon)<br />
<br />
CurrentMaxDocumentIDForASpecificUser = Get_MaxDocumentIDForASpecificUser_ObjCmd.ExecuteScalar<br />
<br />
If CurrentMaxDocumentIDForASpecificUser Is DBNull.Value Then<br />
<br />
CurrentMaxDocumentIDForASpecificUser = 0<br />
Else<br />
<br />
End If<br />
<br />
MyCon.Close()<br />
End Sub<br />
changes in bold. now its working. thanks for replying
|
|
|
|
|
First of all, this is sql question
The problem is because when the table is empty, it doest have a value on that column
What you need is to chnage this:
Get_MaxDocumentIDForASpecificUser_StrSQL = "Select max(DocumentID) from UploadedDocuments where Owner='" & Trim(Session("CurrentlyLogedinUserName")) & "'"
Get_MaxDocumentIDForASpecificUser_StrSQL = "Select max(isnull(DocumentID,0)) from UploadedDocuments where Owner='" & Trim(Session("CurrentlyLogedinUserName")) & "'"<br />
Alexei Rodriguez
|
|
|
|