|
AFAIK once you have Response.End() then you can't do anything after that.
-----
|
|
|
|
|
Ok, so how do i accomplish the "wait for page" task?
|
|
|
|
|
Response.AppendHeader("content-disposition",
"attachment; filename=" + name);
by ths iam getting file down loadmessage as open, save cancel option by clicking the save option iam saving the file sucessfully in the client machine but now i want the path where the file was saved
|
|
|
|
|
You can't get it. The browser (rightfully, for security reasons) cannot access resources on the user's local machine. Why would you want this information anyway?
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
|
I have 2 webforms form1.aspx and form2.aspx. on form1 i have 2 buttons EDIT and NEW and on form2 i have SAVE and UPDATE .... I want to disable UPDATE button on form2 when i click NEW buttton on form1 and similarily i want to disable SAVE button when i click EDIT button in form1 . as EDIT buttton only should enable UPDATE and NEW should enable only SAVE
please ..Its Urgent !!
|
|
|
|
|
You should use the Session object or Cache to pass the information between the different forms.
As your example, there is two buttons called "Edit" and "New" on WebForm1. If the user clicks the "New" button, you wanna enable the "Save" button and disable "Edit" button on WebForm2.
then, write the following code in WebForm1
In btnNew_Click() event,
Session["IsNew"] = true;
In btnEdit_Click() event,
Session["IsNew"] = false;
In Page_Load() event of WebForm2 ~
<br />
btnSave.Enabled = Session["IsNew"];<br />
btnUpdate.Enabled != Session["IsNew"];
Note: You should check whether the session is already exist or not.. If this session object is not exist then you will get the error..
Hope it helps..
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
"Please vote to let me (and others) know if this answer helped you or not. A 5 vote tells people that your question has been answered successfully and that I've pitched it at just the right level. Thanks."
|
|
|
|
|
thanks for reply ..but i want both to happen i.e. if user clicks the "New" button, i wanna enable the "Save" button and disable "Update" button on WebForm2. and when user clicks EDIT button , i wanna enable Update button and disable Save button ..
few errors i got for previous reply
1)Operator '!=' cannot be applied to operands of type 'bool' and 'object'
2)Cannot implicitly convert type 'object' to 'bool'. An explicit conversion exists (are you missing a cast?)
3)Only assignment, call, increment, decrement, and new object expressions can be used as a statement
|
|
|
|
|
Please change like this below..
In Page_Load() event of WebForm2 ~
<br />
btnSave.Enabled = (bool)Session["IsNew"];<br />
btnEdit.Enabled = !(bool)Session["IsNew"];
OR
if (Session["IsNew"] == true){<br />
btnSave.Enabled = true; <br />
btnEdit.Enabled = false;<br />
}<br />
else{<br />
btnSave.Enabled = false; <br />
btnEdit.Enabled = true;<br />
}
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
"Please vote to let me (and others) know if this answer helped you or not. A 5 vote tells people that your question has been answered successfully and that I've pitched it at just the right level. Thanks."
|
|
|
|
|
hey thanx a lot thats working !!!
|
|
|
|
|
hi , i need ur help i m doing asp.net 2005 using C# , so i want 2 send emails automatically from database at a particular time. so what can i do this program ..plz..tell me..
thanks 2 all..
|
|
|
|
|
Rajeshwar Developer wrote: i want 2 send emails automatically from database at a particular time
You can use SQL xp_sendmail function to send a mail from SQL database.
Example ~
<br />
EXEC master.dbo.xp_sendmail <br />
@recipients=N'danw@Adventure-Works.com',<br />
@message=N'The master database is full.' ;
If you wanna run this code at a particular time, you can create the SQL-Job in database.
Hope it helps. Feel free to let us know if you still have the questions..
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
"Please vote to let me (and others) know if this answer helped you or not. A 5 vote tells people that your question has been answered successfully and that I've pitched it at just the right level. Thanks."
|
|
|
|
|
EXEC master.dbo.xp_sendmail how to create this sql job..
thanks 2 all..
|
|
|
|
|
You can create a job from T-SQL or design.. Please check-out the link below for more information.
http://technet.microsoft.com/en-us/library/ms186273.aspx
Hope it helps.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
"Please vote to let me (and others) know if this answer helped you or not. A 5 vote tells people that your question has been answered successfully and that I've pitched it at just the right level. Thanks."
|
|
|
|
|
thanks brother...now i ll create a t sql job ..after that i ll ask u doubts..ok ...brother bye..take care..
thanks 2 all..
|
|
|
|
|
in stored pocedure , we know the no the variable that are declared into the sored pocedure.so in code behind we assign their values and send them to stored procedue.so we know how many variables , we have to pass.what if we have we don;t know .I mean can't i use the split function in stored procedure or it's alternative?
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
|
|
|
|
|
There is no build-in split function in SQL but you can create your own custom function.. You can google about this "SQL split function"
For example: A SQL Split Function
Hope it helps..
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
"Please vote to let me (and others) know if this answer helped you or not. A 5 vote tells people that your question has been answered successfully and that I've pitched it at just the right level. Thanks."
|
|
|
|
|
You Can Try This
Hope It is exact What u want.
<br />
Create FUNCTION [dbo].[fn_split] (<br />
@SourceString sql_variant,<br />
@Delimiter nvarchar(10) = N','<br />
)<br />
RETURNS @Values TABLE( Position smallint IDENTITY, cValue varchar( 8000 ) , ncValue nvarchar( 4000 ) )<br />
AS<br />
BEGIN<br />
DECLARE @NormalString varchar( 8000 ) , @NationalString nvarchar( 4000 ) ,<br />
@NormalDelimiter varchar( 10 ) , @NationalDelimiter nvarchar( 10 ) ,<br />
@IsNationalChar bit , @Position int ,<br />
@NormalValue varchar( 8000 ) , @NationalValue nvarchar( 4000 )<br />
SET @Delimiter = COALESCE( @Delimiter, N',' )<br />
SET @IsNationalChar = CASE<br />
WHEN SQL_VARIANT_PROPERTY( @SourceString , 'BaseType' ) IN ( 'char' , 'varchar' )<br />
THEN 0<br />
WHEN SQL_VARIANT_PROPERTY( @SourceString , 'BaseType' ) IN ( 'nchar' , 'nvarchar' )<br />
THEN 1<br />
END<br />
IF @IsNationalChar IS NULL RETURN<br />
IF @IsNationalChar = 0<br />
BEGIN<br />
SET @NormalDelimiter = @Delimiter<br />
SET @NormalString = CAST( @SourceString AS varchar(8000) )<br />
<br />
IF LEFT( @NormalString , LEN( @NormalDelimiter ) ) = @NormalDelimiter<br />
SET @NormalString = SUBSTRING( @NormalString, LEN( @NormalDelimiter ) + 1, 8000 )<br />
IF RIGHT( @NormalString , LEN( @NormalDelimiter ) ) <> @NormalDelimiter<br />
SET @NormalString = @NormalString + @NormalDelimiter<br />
WHILE( 1 = 1 )<br />
BEGIN<br />
SET @Position = CHARINDEX( @NormalDelimiter , @NormalString ) - 1<br />
IF @Position <= 0 BREAK<br />
SET @NormalValue = LEFT( @NormalString , @Position )<br />
SET @NormalString = STUFF( @NormalString , 1 , @Position + LEN( @NormalDelimiter ), '' )<br />
INSERT INTO @Values ( cValue ) VALUES( @NormalValue )<br />
END<br />
END<br />
ELSE IF @IsNationalChar = 1<br />
BEGIN<br />
SET @NationalDelimiter = @Delimiter<br />
SET @NationalString = CAST( @SourceString AS varchar(8000) )<br />
<br />
IF LEFT( @NationalString , LEN( @NationalDelimiter ) ) = @NationalDelimiter<br />
SET @NationalString = SUBSTRING( @NationalString, LEN( @NationalDelimiter ) + 1, 4000 )<br />
IF RIGHT( @NationalString , LEN( @NationalDelimiter ) ) <> @NationalDelimiter<br />
SET @NationalString = @NationalString + @NationalDelimiter<br />
WHILE( 1 = 1 )<br />
BEGIN<br />
SET @Position = CHARINDEX( @NationalDelimiter , @NationalString ) - 1<br />
IF @Position <= 0 BREAK<br />
SET @NationalValue = LEFT( @NationalString , @Position )<br />
SET @NationalString = STUFF( @NationalString , 1 , @Position + LEN( @NationalDelimiter ), '' )<br />
INSERT INTO @Values ( ncValue ) VALUES( @NationalValue )<br />
END<br />
END<br />
RETURN<br />
END<br />
Just Do IT™ [Information Technology]™ ;->
|
|
|
|
|
Hi,
I want to access the cells address of a gridview control on click or double click...
In Windows application with DatagridView it's quite easy..
How can i get the same in asp.net gridview control
Sangram
(A battle with self)
Life is simple, we are the ones makes the living difficult
|
|
|
|
|
what you are trying to do?
if you want to postback the page then you can achieve this by adding the following attribute in RowDataBound of the gridview:
<br />
foreach TableCell cell in curRow.Cells<br />
{<br />
cell.Attributes.Add("id",cell.ClientID);<br />
cell.Attributes.Add("onclick", "javascript:document.formname.submit();");<br />
}<br />
in the event handler for the cell you can get the ID of the sender;
and if you want to do something on client side using javascript then do this:
<br />
foreach TableCell cell in curRow.Cells<br />
{<br />
cell.Attributes.Add("id",cell.ClientID);<br />
cell.Attributes.Add("onclick", "javascript:getTheCell(this);");<br />
}<br />
and in javascript file do this:
<br />
function getTheCell(cell)<br />
{<br />
alert('You clicked cell ID: '+ cell.ID);<br />
}<br />
-----
|
|
|
|
|
Hi SABhatti,
I am preparing a seatlayout type of application using a gridview. i am generating a gridview but i want to store the cells address on click in a listbox or list item and later store them in database...
I think i have descibe clearly above....
I am trying using the solution...as u gave
But If there a better way or a link where I can refer I will be glad..
Sangram
(A battle with self)
Life is simple, we are the ones makes the living difficult
|
|
|
|
|
if you are using AJAX then you can even do a partial postback and store that address on the server.
But I will suggest the javascript solution I gave you in my previous response. In that javascript function store the ID's in a hidden filed separated by comma and highlight the cells (change the backround color using stylesheet cell.className in javascript). when user submit the form get the clicked cells from hidden field, split them based on , and store them in database.
-----
|
|
|
|
|
Hi SABhatti,
I am trying the solution provided but it's not getting the cellId...
It shows in alert;
You have clicked the cell: undefined
Need urgent help please
Sangram
(A battle with self)
Life is simple, we are the ones makes the living difficult
|
|
|
|
|
ok are you doing this in rowdatabound of the gridview
<br />
foreach (TableCell cell in e.Row.Cells)<br />
{<br />
cell.Attributes.Add("id",cell.ClientID);<br />
cell.Attributes.Add("onclick", "javascript:getTheCell(this);");<br />
}<br />
<br />
and in javascript file do this:
// sorry .id is lower case
<br />
function getTheCell(cell)<br />
{<br />
alert('You clicked cell ID: '+ cell.id);<br />
}<br />
-----
|
|
|
|
|
Hi professionals,
I am planning to launch a website like youtube, but it is meant for different purpose, it will have very similar functionality to youtube, more precisely it will have:
1. Simple interface design, but professional design (I mean no graphical complications, yet great reachbility of video content).
2. Makes intensive use of AJAX to update the user-interface.
3. Needs to be able to handle thousands of users surfing the site at the same time.
4. Needs to manipulate large amounts of data in different databases efficiently.
5. Needs to embed media controls like flash video, real player, windows media player in web-pages.
6. Functionality includes user profiles, e-mailing, video rating, video commenting and everything youtube has.
I don't know what technology I should use in building this project, is it ASP .NET or PHP? I know little about ASP .NET and I know nothing about PHP.
I need to use a tool that is very productive, relatively easier and reliable to build a world-class project, I need it to be able to handle millions of records and thousands of users surfing the website simaltanously.
Any help professionals?
Thanks in advance.
-- modified at 8:13 Monday 19th November, 2007
And ever has it been that love knows not its own depth until the hour of separation
|
|
|
|