|
hmmm... I did it here and it worked fine, you have to give it an id too (though I suspect you did that), but I'm using .NET 2.0 so that might be the issue?
|
|
|
|
|
Yup...I do have the ID specified. id=myBody runat = server
Could you please tell me how to accomplish that using CSS. I know little about the CSS stuff but I'll be learning about them. Creating a css is not a problem, but how do I dynamically change those colors, fonts and other things I mentioned in my prior post using the CSS approach. Please let me know if you have any input?
Thanks
|
|
|
|
|
Also, since I didn't see the "myBody" element declaration in the code behind...I figured I could do that myself. So I tried to declare a variable
of type HTMLcontrol protected System.Web.UI.HtmlControl....but guess what...the body element is not a member of HTMLControl class either. So I tried using it with HtmlForm element. And in my html I made the form element (runat = server and set the ID = myForm) but even that doesn't show up in my code behind programatically.
Because if that shows up...then like you suggested, I could have done
myForm.Attributes.Add("bgcolor", color);
THANKS for you time.
Tina
|
|
|
|
|
Hey Display name eggsovereasy:
Thanks for all your help with the color stuff. Apparently the only things missing (which 1.1 doesn't do automatically was the declaration of the body's id as a protected variable of type HtmlGenericControl). So thanks sooo much for your help.
Anyways, I have another question for you.
I want the user to be able to select font (such as Bold, Italic, underline) and stuff like that from a dropdown list) and then I wanna apply these properties to all my page (all text). Now I'm doing something like this:
string font = string.Empty;
switch(ddl2.SelectedItem.Text)
{
case "Bold":
font = Convert.ToString(System.Drawing.FontStyle.Bold);
break;
case "Italic":
font = Convert.ToString(System.Drawing.FontStyle.Italic);
break;
}
myBody.Attributes.Add("Font", font);
Session["theColor"] = font;
This worked for changing the color of the entire page as I hard coded the colors hexa decimal values in the cases, but here these are enums, and can only be compared.
Anyways does anyone has any input on this???? I want this to happen when the user select from the DDL and on the button click event it should change the font.
Thanks
Tina
|
|
|
|
|
I have a gridview with a link in the parent page.when i click on the link it opens up another gridview.this child gridview has 2 columns,one is a checkbox created using an itemtemplate and another a boundfield retreiving data from the database.what i want is when i check the checkbox of a particular row and hit a button,the data existing in that particular row of the child gridview which has been checked,has to transfer the data from that row to the parent gridview,in a sense the parent gridview has to refresh and show up with the new data that has come from the child gridview control.How can i do this?..........urgent..........
hi
|
|
|
|
|
If you want to use pop up window for child gridview, write
window.open ("popupwindowname.aspx","mywindow","toolbar=no,scrollbars=yes,resizable=yes,menubar=0,width=700,height=520");
in Parent window design page.
And write
Session("var1") = gvChild.SelectedDataKey.Value.ToString()
Dim scriptSubmit As String = " window.opener.document.forms(0).submit(); "
If Not Page.ClientScript.IsClientScriptBlockRegistered(scriptSubmit) Then
Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), "script", scriptString)
End If
Dim ScriptClose As String = " window.close();"
Page.ClientScript.RegisterClientScriptBlock(Me.GetType, "Close", ScriptClose)
In popup window button click. It will refresh the parent page. In the pageload, with the help of session(“var1”), you can load the new data in the parent gridview.
-Priya
|
|
|
|
|
Hi Priya,tx,for the reply.can u please give me the solution for the above question using c#.and also i need the page load event for the parent.
Many Thanks,
Harsha
hi
|
|
|
|
|
Sure…
Hope you understand that window.open(…..); should be written in javascript function which will be called when the user clicks the link of the parent gridview.
And in child window , I think, it is better to add an auto generated select button instead of a checkbox, if that doesn’t serve for a special purpose other than to indicate the desired row. Because, it may be ambiguous, if you check multiple checkboxes at a time. If you add select button, the user can select the desired row and click the button.
In button click,
//assign the primary key value of the selected row into a session variable
//For this, you should have assigned the primary key field to the DataKeyNames property //in the design mode(or at codebehind) of the gridview
Session(“var1”)=gvChild. SelectedDataKey.Value.ToString();
String scriptSubmit== " window.opener.document.forms(0).submit(); ";
If(!Page.ClientScript.IsClientScriptBlockRegistered(scriptSubmit))
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "script", scriptString);
string ScriptClose = " window.close();";
Page.ClientScript.RegisterClientScriptBlock(this.GetType, "Close", ScriptClose);
In parent window page load,
if(Session(“var1”)!=””)
{
//do the required using this session variable since this holds the primary key value of the record
// I’ve not written the code because I’m not aware of your exact requirement whether insertion or modification)
Session(“var1”)=””;
00000//better to clear the session even in the Session_End event of global.asax
}
Hope this may help you. You are welcome, if you have any queries regarding this.
-Vishnu Priya
|
|
|
|
|
i have a server that does not have internet access so when i ran my aspx project the flashes on the pages are not be shown.
normally on other pc's that have internet when i put on my web application it simply downloads flash from the internet if it is not installed.
i downloaded a shockwave version and ran it on the server and it said it was installed but my flashes are still not been shown.
anyone can tell me what i should or what i am doing wrong
|
|
|
|
|
Hi guys!
I'm creating a web application with a table containing files the users have uploaded to the site. Now for every entry in the table I have a little "trash" icon, so when clicked, the system will delete the file. Now - here is my problem: It doesn't work! Surprise huh! Well it seems like the Command event of the ImageButton never gets fired. I've tried having it throw an exception, but nothing happens, the page just reposts whenever the image is clicked.
I do not use the ASP.NET data table WebControl (the one you see in almost every tutorial about ASP.NET and data access) - because it does not fit into my needs. And to be honest: I don't like it that much either.
I have this code in my ASP.NET page's CodeBehind file's Page_Load method (please don't think to much about the variable names, as some of them are in Danish):
ImageButton imgb = new ImageButton();
imgb.CommandArgument = b.DbId.ToString();
imgb.CommandName = "Delete";
imgb.Command += this.DeleteFile;
imgb.ImageUrl = "~/Images/trash.gif";
imgb.ID = "cmd" + b.DbId.ToString();
I have this code in the "DeleteFile" method, which matches the Delegate for the Command event:
protected void DeleteFile(object sender, CommandEventArgs e)
{
Int32 bilagId = Int32.Parse(e.CommandArgument.ToString());
BilagHandler.Delete(bilagId);
throw new Exception("wtf!");
FillBilagTable();
}
The WTF Exception never gets throwed - ergo: The code never executes! Any clues? I'm really confused.
And perhaps this post is a stupid question, but I'm just code-blind by now - hey - so be it!
BTW: The code compiles without any errors.
Best regards
Soeren
|
|
|
|
|
Wire up the handler to the Click event, not Command.
|
|
|
|
|
It does not work either. Neither the Click or the Command event gets fired. I forgot to write, that I've tried the Click event as well.
Btw. the both the command event and the click event should be fired when the ImageButton is clicked. The Command Event gives me the benefit of having access to the CommandArgument, which can tell me the id of the file to be deleted. The click event cannot.
Best Regards
Soeren
|
|
|
|
|
Try this:
imgb.Command += new CommandEventHandler(this.DeleteFile);
EDIT
-------------
nm, saw you tried it with new as well...
Does it even do a post back?
Try setting the AutoPostBack property to true;
|
|
|
|
|
It does produce a postback. I've even tried setting the PostBackUrl property, even though it should not be necessary.
My theory is that I forgot to set some property that makes the ImageButton fire its events, but I can't find out which property it is. It makes no sense.
Best Regards
Soeren
|
|
|
|
|
Hi, to all...
In my project i open outlook page for new message, in subject i set some text (using C#) but in body i want to draw table (to set number of rows and columns using C#, this table should be same as we draw in MSWord. Hope I was clear).
|
|
|
|
|
hi,
is there any way to fill a GridView with the contents of a DataTable object? The object is correct, can see the values etc, but how do i display them in a GridView???
thanx
|
|
|
|
|
Can't you just set the datasource of the gridview to be the datatable, and call databind ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
thank you for this! i'm very new to it, i thought you should have a datasource object for that, but as you said, datatable + bind worked great!
thank you
|
|
|
|
|
Is it possible to modify this control so that you supply it with an email address rather than your username?
Thanks,
|
|
|
|
|
It's default is with mail, so where do you think it will send the recovery options ?
------------------------------ "The Soapbox has been so ..."
|
|
|
|
|
Sorry I might not have explained it very well.
It will send you your email but first you have to supply the control with your username, then it will send you your password.
I want to change this and have the user supply their email address then have the password sent to that email address, of course being that the email address is in the DB. Also my membership has requiresUniqueEmail="true" so there will be no duplicate email addresses.
|
|
|
|
|
Noway, you must provide the username, I think it might be a way through the administrator tool.
------------------------------ "The Soapbox has been so ..."
|
|
|
|
|
What is the max file size limit that can be uploaded by File Upload control?
Can u give code to set the maximum file size in File Upload control?
Thanks and Regards,
sdaniel_cst
|
|
|
|
|
The maximum file size is controlled via config file. The maximum size for .NET1/1.1 is 1GB. For .NET2 it is 2GB. By default, the size is 4096K (4MB). To change the size, you specify the following:
<httpRuntime maxRequestLength="value in K" executionTimeout="3600" />
It is not a good idea to let this value get too big because ASP.NET loads the item into memory as it is uploading, so large values quite often result in Out of Memory exceptions.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Thanks very much for your reply...
sdaniel_cst
|
|
|
|