|
I suspect that 'Formview' means this is a winforms question ?
If you want to assign a value that's actual code, not a static string, you need to write actual code, not use the designer.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Oh definitely, i've tried different CType and DirectCast functions and I cant get it to dynamically assign the TextBox the User.Identity.Name string.
I'm doing this in VB.
Thanks.
|
|
|
|
|
Here is what I have:
a gridview that has listed tickets, and when you select on a ticket, it pops up the formview
the formview has editable fields and one field i wish to not have edited is the "modified by" text box
so i tried this:
Protected Sub FormView1_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles FormView1.DataBound
If FormView1.CurrentMode = FormViewMode.Edit Then
Dim ModifiedBy As TextBox = CType(FormView1.FindControl("ModifiedByTextBox"), TextBox)
If Not ModifiedBy Is Nothing Then
ModifiedBy.Text = User.Identity.Name
End If
End If
End Sub
Still resulted in the Modified By textbox have the already assigned value that was pulled in the query.
|
|
|
|
|
|
I have a aspx page that shows results from a database. How can yo mimic the client to think that the submit button has been clicked and update the results from a database. I want this to be done periodically. Thanks
|
|
|
|
|
In the code behind, all you have to do is:
[button name].click()
Pete Soheil
DigiOz Multimedia
http://www.digioz.com
|
|
|
|
|
You could use a javascript timer object to periodically refresh the page.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
solarthur01 wrote: I want this to be done periodically.
An elegant blend of JavaScript Timer and a XMLHttp should work charms here.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
i have a login page wid login check up loop as
if (userType.Equals("Administrator"))
{
Response.Redirect("successPage.aspx");
}
else if (!userType.Equals("Administrator"))
{
errMessage.Text = " Login Incorrect!! " ;
}
login works well..but if i click wrong details.. it displays nothing.. i want to display text above... how to do this ??
|
|
|
|
|
To Display Message Box - Response.Write(" alert('Loging Incorrect');");
|
|
|
|
|
Hi all!
I have a gridview with an imagebutton inside a templatefield
<asp:TemplateField><ItemTemplate>
<asp:ImageButton ID="Riepilogo" runat="server" CommandArgument="<%#((GridViewRow)Container).RowIndex%>"
ImageUrl="~/img/search.png"
CommandName="riepilogo" ToolTip="Riepilogo impianto"
onClick="prova" OnClientClick="src='img/blue_loader.gif'; Visible='True'"/>
</ItemTemplate></asp:TemplateField>
When i click that imagebutton, the onclientclick event changes the standard
image to a "waiting" animated gif.
The code for CommandName is something like that:
...
Response.ClearHeaders();
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment;
filename=output.pdf");
Response.ContentType = myStuff.getAppSetting("ContentTypePDF");
Response.Flush();
Response.BinaryWrite(pdf);
Response.End();
...
This generates a PDF file that pops up for the download.
Now i have to change the image back to normal (not waiting). How do i
accomplish this?
Thank you in advance.
|
|
|
|
|
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."
|
|
|
|