|
Hey Thanks bro for the hint ...
Cheers
KaKaShi HaTaKe
|
|
|
|
|
Add this <httpruntime maxrequestlength="8192" /> on webconfig to set size of upload in 8MB
_________________________________________________________________________
|
|
|
|
|
Good Afternoon,
I recently added a drop down list box to my ASP.NET 2.0 Windows form page. It had the simple function of allowing the user to select a site identification number and posting it to a label that could be referenced for future queries. I have used this hundreds of time on C# desktop applications. The problem is....IT DOESN'T WORK! I created the event from the Properties box of the control. When it did nothing, I put a 'STOP' on it for diagnostics only to find that changing a selection DID NOT run the code, as if it wasn't there at all. The code is below:
protected void DropDownListSites_SelectedIndexChanged(object sender, EventArgs e)
{
LabelSite.Text = DropDownListSites.Text;
}
I thought these events were automatic......any ideas???? Thank You, Pat
|
|
|
|
|
please check that autopostback property is set to true.
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
YES...Thank You...BUT...this seems to have created another problem. Now, each time the box is activated, it reloads the information in the list content so that content is added over and over. I have not looked at this yet, but I suppose some sort of conditional statement will cure this. IF you know of one off the top of your head, let me know. I've done a lot with C# but am a relative newcomer to ASPX.
Many thanks for your help.>>>Pat
|
|
|
|
|
I have a project where this is important.
|
|
|
|
|
Metascan is implemented (internally) in C++. However, we expose everything through COM, and this allows .NET clients to use it seamlessly. We offer sample code in C# that demonstrates how it is done. There is no difference from the C# point of view if the code is internally implemented in something other than .NET (no extra code is needed in order to use the COM object; It appears to be a regular .NET class).
|
|
|
|
|
You obviously have TWO accounts, asked and answered yourself about some 3rd party software.
Blog link to be reinstated at a later date.
|
|
|
|
|
Your post makes no sense at all.
"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
|
|
|
|
|
To create an administrative user
1. In the Website menu, click ASP.NET Configuration.
2. Click the Security tab.
When I click on the security tab ill get this:
There is a problem with your selected data store. This can be caused by an invalid server name or credentials, or by insufficient permission. It can also be caused by the role manager feature not being enabled. Click the button below to be redirected to a page where you can choose a new data store.
The following message may help in diagnosing the problem: Unable to connect to SQL Server database.
I then click on the "Choose Data Store" button, which takes me to the "Provider" tab. At this point I click on the link to choose a single provider. On the next page, I select "AspNetSqlProvider" (the only option available) and click on the "Test" link.
At this point, I get an error page. Contents pasted below.
FYI: I have not installed the SQL Server 2005 Developer Edition, cause I thought that VS is gonna setup a server without any problems by itself.
What's the probelm and what can I do to finally begin with the getting started? thanks for your help!
|
|
|
|
|
Is the connectionstring in your web.config correct? Is the membership asociated to that connectionstring?
|
|
|
|
|
I have developed a component for my web application using C#. Now I want to reuse same component for a console app also.
Now I need to identify whether the request is coming from console application or web app..other than that the component is independent of any session or source.
I do not want to pass hint through a var..
any other ideas???
Keep DotNetting!!
GeekFromIndia
|
|
|
|
|
you can check to if the HttpContext is null.If HttpContext is not null then its an ASP.NET web application:
if (HttpContext.Current != null)
{
}
|
|
|
|
|
I was wondering as a user of Metascan am I entitled to "free" upgrades during my period of licensing and am I supported?
|
|
|
|
|
Licensed users of Metascan are entitled to free upgrades to the next version of Metascan (during the license period). Each release of Metascan is supported until the next version is out (i.e. Metascan 2.1 was supported until Metascan 2.2 came out).
If an issue is reported in an older release, we would ask you to upgrade to the most recent version, as chances are the issue has been resolved. If the issue has not yet been resolved, we will resolve it in our next release or possibly as a patch depending on the severity of the issue.
|
|
|
|
|
I’m having and issue firing code behind on one of my asp buttons.
Screen Shot 1 - http://beta.sdsna.com/ModalFiles/ss1.jpg - Prior to clicking the update button
Screen Shot 2 - http://beta.sdsna.com/ModalFiles/ss2.jpg - Box after clicking the update button, no event behind was fired
Project Files - http://beta.sdsna.com/ModalFiles/AJAXModalPopup.zip
Project Overview:
I have one list page (UserList.aspx) that contains a ModalPopupExtender. An ascx control (ModalContainer.ascx) loads within that ModalPopupExtender and retrieves a few parameters set by the list page. Based on one of the parameters, the ModalContainer.ascx control dynamically loads in another ascx control. The control that gets loaded in could be to edit user, add user, etc.
Everything works fine except on the last ascx control that gets loaded in. On that control I have an asp submit button which should fire code behind but does not.
UserList.aspx
UserList.aspx contains an add user button which calls a JavaScript function ShowModalPopup and accepts up to 4 parameters. When this function is called it sets global JavaScript variables of the passed parameters and then opens up the ModalPopupExtender which has the ModalContainer.ascx control inside.
ModalContainer.ascx
When the popup extender is opened the ascx control has a JavaScript function for pageLoad(). The pageLoad() function does $find(“ModalPopupExtender”).add_shown(SetPostBack);.
The SetPostBack() function does the following – gets the global JavaScript variables and inserts the values into hidden text box fields and then fires btnPostBack.click(); which is a hidden button on the form.
I have an update panel with the ContentTemplate having an ASP:Placeholder and the Trigger being btnPostBack with EventName=”Click”.
So when this button is clicked, the code behind reads the values in the hidden text boxes and loads into the ASP:Placeholder the proper ascx control – it being UserEdit.ascx for this example.
UserEdit.ascx
This control contains 3 ASP:Textboxes, UpdatePanel and ASP:RequiredFieldValidators. In the code behind page load event I again read the values in the hidden text boxes and populate the form from the database.
The purpose of the update panel is when the user clicks the update button, I validate that the username is not already taken and if it is I show a message label that is in the ContentTemplate of the update panel.
All of the above works fine except when I click the update button. On clicking of the update button it does not fire the Click event in the code behind. Instead it basically closes itself and what I am left with is a blank modal popup.
The RequiredFieldValidators do work - just the code behind event does not. Removing the validators does not fix the problem either..
Any idea’s or how I should approach this in a different manner to accomplish my goal?
ModalContainer.ascx - CODE <br />
<br />
<!-- Post Back Javascript Code Start --><br />
<script language="javascript"><br />
function pageLoad(){<br />
$find("ModalContainerPopupBehavior").add_shown(SetPostBack);
}<br />
<br />
function SetPostBack(){ <br />
var objParam1TextBox = '<%=txtParam1.ClientID %>';<br />
document.getElementById(objParam1TextBox).value=vParam1;<br />
<br />
var objParam2TextBox = '<%=txtParam2.ClientID %>';<br />
document.getElementById(objParam2TextBox).value=vParam2;<br />
<br />
var objParam3TextBox = '<%=txtParam3.ClientID %>';<br />
document.getElementById(objParam3TextBox).value=vParam3; <br />
<br />
var objParam4TextBox = '<%=txtParam4.ClientID %>';<br />
document.getElementById(objParam4TextBox).value=vParam3; <br />
<br />
var objControl = '<%=btnPostBack.ClientID %>';<br />
document.getElementById(objControl).click(); <br />
} <br />
<br />
</script><br />
<!-- Post Back Javascript Code End --><br />
<br />
<!-- Hidden Text Boxes to Pass Values from Calling Form --><br />
<asp:TextBox ID="txtParam1" runat="server" style="display:none;"></asp:TextBox><br />
<asp:TextBox ID="txtParam2" runat="server" style="display:none;"></asp:TextBox><br />
<asp:TextBox ID="txtParam3" runat="server" style="display:none;"></asp:TextBox> <br />
<asp:TextBox ID="txtParam4" runat="server" style="display:none;"></asp:TextBox> <br />
<br />
<!-- Hidden Postback button used to post back form on load to set Hidden Text Box Values --><br />
<asp:Button ID="btnPostBack" runat="Server" Text="Post Back" style="display:none;" CausesValidation="false" /> <br />
<br />
<asp:UpdatePanel ID="updPostBack" runat="server"> <br />
<ContentTemplate><br />
<asp:PlaceHolder ID="phModal" runat="server"></asp:PlaceHolder><br />
</ContentTemplate><br />
<Triggers> <br />
<asp:AsyncPostBackTrigger ControlID="btnPostBack" EventName="Click" /><br />
</Triggers><br />
</asp:UpdatePanel> <br />
<br />
<br />
<br />
UserEdit.ascx CODE BELOW<br />
<br />
<table cellpadding="0" cellspacing="4" border="0"><br />
<tr><br />
<td colspan="2">User Edit</td><br />
</tr> <br />
<tr><br />
<td>First:</td><br />
<td><asp:TextBox ID="txtFirstName" runat="server" CssClass="input" MaxLength="50"></asp:TextBox></td><br />
</tr><br />
<tr><br />
<td>Last:</td><br />
<td><asp:TextBox ID="txtLastName" runat="Server" CssClass="input" MaxLength="50"></asp:TextBox></td><br />
</tr><br />
<tr><br />
<td>User:</td><br />
<td><asp:TextBox ID="txtUserName" runat="server" CssClass="input" MaxLength="50"></asp:TextBox></td><br />
</tr><br />
<tr><br />
<td colspan="2" align="right"> <br />
<input type="button" value="Cancel" onclick="CloseModalPopup('ModalContainerPopupBehavior');" /><asp:Button ID="btnUpdateUser" runat="server" Text="Update User" CssClass="formButton" /> <br />
</td><br />
</tr> <br />
</table> <br />
<br />
<asp:UpdatePanel ID="updSubmit" runat="server"><br />
<ContentTemplate> <br />
<asp:Label ID="lblMessage" runat="Server"></asp:Label><br />
</ContentTemplate><br />
<Triggers><br />
<asp:AsyncPostBackTrigger ControlID="btnUpdateUser" EventName="Click" /> <br />
</Triggers> <br />
</asp:UpdatePanel> <br />
<br />
<!-- Validation Controls --><br />
<asp:RequiredFieldValidator runat="server" ID="vFirstName" ControlToValidate="txtFirstName" SetFocusOnError="true" Display="None" ErrorMessage="<b>Required Field Missing</b><br />First name is required." /><br />
<ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="veFirstName" TargetControlID="vFirstName" /> <br />
<br />
<asp:RequiredFieldValidator runat="server" ID="vLastName" ControlToValidate="txtLastName" SetFocusOnError="true" Display="None" ErrorMessage="<b>Required Field Missing</b><br />Last name is required." /><br />
<ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="veLastName" TargetControlID="vLastName" /> <br />
<br />
<asp:RequiredFieldValidator runat="server" ID="vUserName" ControlToValidate="txtUserName" SetFocusOnError="true" Display="None" ErrorMessage="<b>Required Field Missing</b><br />User name is required." /><br />
<ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="veUserName" TargetControlID="vUserName" />
modified on Tuesday, September 2, 2008 6:54 PM
|
|
|
|
|
I am accessing a FORTRAN dll into ASP.Net 2005. The dll is taking input from a .dat file after processing it generates another .dat as an output. Here's ASP.Net is working as an interface of Input(by which user can supply input file) and Output(by which user can see the output in various listbox, textbox,etc).
I used importdll atrribute to declate DLL, and used call keyword to call the function of DLL. The program is working fine when i am executing using .NET IDE. but when i published the application it doesn't work. ASP.Net Application stops IIS on function call of FORTRAN dll.
Regards
Manoj Shukla
|
|
|
|
|
hi,
Can any body please help me? When I am opening the asp.net configuration it giving me this error as follows.
Provider Management
Could not establish a connection to the database. If you have not yet created the SQL Server database, exit the Web Site Administration tool, use the aspnet_regsql command-line utility to create and configure the database, and then return to this tool to set the provider.
What I need to do to connect to sql server. I have already installed sql still its showing me this error.
|
|
|
|
|
pinkidasu wrote: When I am opening the asp.net configuration it giving me this error as follows.
Which Configuration File are you opening ?
pinkidasu wrote: What I need to do to connect to sql server. I have already installed sql still its showing me this error.
I think you are trying to do any personalization or membership kind of operation.
Do one thing
From VS Command Prompt - > Run aspnet_regsql Command
This it will as for the data base and give the database server name . It will create some personalization table and procedure on your database.
Hope then your problem will be resolved !!!
Thanks
|
|
|
|
|
you need to add membership configuration to web.config. Take a look at this article:
Membership[^]
|
|
|
|
|
Hi guys i have a issue. I use Mailattachment to send my attachment how ever if my attachment size is too huge. The sending fail. Is there a way to fix or increase the size of my attachment size for attachment.
KaKaShi HaTaKe
|
|
|
|
|
This is because of the fact that Mail Server sets the maximum size to send/accept the attachment.
If its over its limit, it fails...
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
bro are u saying is the SMTP? but i can't even upload the file when i submit and it didn't even go into the breakpoint at all.
KaKaShi HaTaKe
|
|
|
|
|
Im developing a small ftp function in my program, but im getting a runtime error message on running this part of the code:
FtpWebRequest request = (FtpWebRequest)FtpWebRequest.Create(FTPAddress + "/" + Path.GetFileName(filePath));
error message:
Unable to cast object of type 'System.Net.HttpWebRequest' to type 'System.Net.FtpWebRequest'.
more info:
FTPAddress has a value of http://server.co.za
the whole function is bellow
private void uploadFile(string FTPAddress, string filePath, string username, string password)
{
//Create FTP request
FtpWebRequest request = (FtpWebRequest)FtpWebRequest.Create(FTPAddress + "/" + Path.GetFileName(filePath));
request.Method = WebRequestMethods.Ftp.UploadFile;
request.Credentials = new NetworkCredential(username, password);
request.UsePassive = true;
request.UseBinary = true;
request.KeepAlive = false;
//Load the file
FileStream stream = File.OpenRead(filePath);
byte[] buffer = new byte[stream.Length];
stream.Read(buffer, 0, buffer.Length);
stream.Close();
//Upload file
Stream reqStream = request.GetRequestStream();
reqStream.Write(buffer, 0, buffer.Length);
reqStream.Close();
MessageBox.Show("Uploaded Successfully");
}
does anyone know what's causing this
|
|
|
|
|
hi all
im doin the application to upload and retrieve the images from database to datagrid ...im saving the images in binary format ..im getting large images in the datagris ..how to display the small images in the image column in datagrid...
plz help me
muppala
|
|
|
|