|
Thanks for your sugession Renu,
I exaclty did the same what u mentioned in the above example, but i am used to connect with sql server 2000, but the error says that sql server 2005.
Is there any conflict to connedct with Sql server 2000 from ASP.NEt 2.0 remotely.
|
|
|
|
|
try giving the ip address of that sql server in the web config file...
hope this works..
Renu.K
|
|
|
|
|
HI
I Also tried this.
Thanks
Paul
|
|
|
|
|
Hi,
I had to run the code in local server after copying it from a shared folder from another system.i am not able to open it at all, the error message i am getting is "web access failed as the default web access is shared mode".Other error message is "required components are not loaded in the local server".Please help because i am unable to continue with my work
|
|
|
|
|
Have you registered the necessary controls on the published server?
|
|
|
|
|
I am attempting to test a browser hosted control in a secure server (IIS 5) environment. My test computer is running .Net 2.0, and the Policy managing the control on the client side is set for full trust (at the moment). My setup is as follows:
Visual Studio 2005 / .Net 2.0 / Win XP SP2 (both .NET 1.1 and 2.0 installed)
IIS 5 on a Win 2000 SP3 server (both .NET 1.1 and 2.0 installed)
ASP classic (migrating to ASP.NET)
IE 6
The server secure site is configured for .NET 1.1 with classic ASP, but my test page is a .NET 2.0 w/ ASP.NET (that is in a virtual directory configured for .net 2). The server has both installed. The server has older because we are preparing to convert the site to ASP.NET and .NET 2.0. It is the only secure server on which I can test at the moment, so I have to live with the mix until the site is fully converted (which may take months). I navigate to my page from the secure login page. This all seems to work fine, and the control runs fine, except when I attempt to call SmtpClient() from my hosted control resulting in a configuration failure during the call. This problem only occurs on the secure server. When running on any other unsecure server, the SMTP works flawlessly, but then I don't have to go through a login page to test on unsecure sites.
Could the problem be happening because of a mix of .NETs (starting to configure from 2.0 schemas and then droping back to the 1.1 schemas and getting confused, or could it be something else. The only thing that SUGGESTS that it might be this is because the error says that the configuration file has a format error in it). I have been trying to find the source of this problem for several days and am out of ideas. I am no closer to finding the problem now than when I started. I would appreciate any help/ideas/suggestions anyone might have. I am at wits end and am almost out of hair
|
|
|
|
|
I’m currently working on a website that we are trying to make accessible. Now I added a page to the site which provide some drop down lists to the users. Such as background color (bgcolor), text size, zoom in (? Not sure how yet), font and things like that. The problem is my very limited experience with ASP.Net. I am a starter. I’d appreciate if one of you guru’s can help me out. Now I can’t or perhaps I should say don’t want to use Java script (user requirement). So basically I have to write server side code that will perform those things (change color, size, font ) etc. Now in my HTML code I have added the runat = “server” attribute to the form element. But that only exposes the Style property when I use it in code behind (under Page_Load event). I don’t want to use style because we won’t be using a CSS for this and I think style property only works with CSS. Since I will be hard coding a few values below in my drop down list and set the values of the color to their hexadecimal value such as #00ff00 for green.
<br />
<br />
<asp:dropdownlist id="ddl2" Runat="server" Width="145px"><br />
<asp:ListItem Value="Select Me">- Select One -</asp:ListItem><br />
<asp:ListItem Value="#ff0033"> RED</asp:ListItem><br />
<asp:ListItem Value="#0000ff"> BLUE</asp:ListItem><br />
<asp:ListItem Value="#00ff00"> GREEN</asp:ListItem><br />
<asp:ListItem Value="#000000"> BLACK</asp:ListItem><br />
</asp:dropdownlist><br><br />
All I want to be able to do when the user clicks the Button, the page and a few more pages will adopt those properties and change color, font etc. The later having the other pages adopt the same values is something I have figured out (I’m planning on using session state for that) Please help me out with this. I even tried exposing a runat = server attribute to the element so that I could programatically change the value of the whole body under the button_click event. But that didn’t work either. Thanks~ Tina
|
|
|
|
|
This sounds like a homework problem (no CSS?)
Anyway try something like this:
runat=server in body tag with an ID
<body runat="server" id="TheBody">
Configure your DDL to AutoPostBack = true and wire up a SelectedIndexChanged handler:
<asp:DropDownList ID="ddlBG" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlBG_SelectedIndexChanged" Width="100px">
<asp:ListItem>Pick one</asp:ListItem>
<asp:ListItem>Red</asp:ListItem>
<asp:ListItem>Blue</asp:ListItem>
<asp:ListItem>Green</asp:ListItem>
<asp:DropDownList>
For some reason it turns "OnSelectedIndexChanged" into "removed"
Then set up your DDL with color choices and do something like this in the code behind:
protected void ddlBG_SelectedIndexChanged(object sender, EventArgs e)
{
string color = string.Empty;
switch (this.ddlBG.SelectedItem.Text)
{
case "Red":
color = "#FF0000";
break;
case "Blue":
color = "#0000FF";
break;
case "Green":
color = "#00FF00";
break;
default:
color = "#dfdfdf";
break;
}
this.TheBody.Attributes.Add("bgcolor", color);
}
This probably won't persist accross pages, but you said you have it figured out using session.
|
|
|
|
|
Hello there, thanks for the response. No it's actually not a hw problem...I'm doing an internship for a pretty small software company. By the way, I did try setting the runat = server attribute on the body element...but I still can't use it programatically on the server side.
i.e theBody.Attribure (this doesn't work) which made me wonder if body and form elements perhaps can't be run at server??? Any ideas why they aren't?
I'm using asp .net 1.1.
Thanks
Tina
|
|
|
|
|
Hello,
If you are using visual studio Environment for the development then you get response from that for asp.net control.
Nimit Patel
|
|
|
|
|
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).
|
|
|
|