|
Hi,
I have a controller that returns a FileContentResult that shows a pdf file in the browser. It works correctly in my local system but after I upload my site and try to reach that page I get "The resource cannot be found(HTTP 404)error".
any suggestion? 
|
|
|
|
|
check MV3 files path on the the upload server.
|
|
|
|
|
Hi,
Is it possible to call a asp.net function from javascript function.?
for example, my code is like this.
<dxe:ASPxComboBox ID="cmbmMicroCause" Width="100%" runat="server" DataSourceID="RootCauseMicroDataSource"
TextField="name" ValueField="code" ClientInstanceName="cmbmMicroCause"
AutoPostBack="false" >
<ClientSideEvents SelectedIndexChanged="function(s,e){OncmbMicroCauseChanged(s);}" />
</dxe:ASPxComboBox>
on the selection change event of
OncmbMicroCauseChanged() and clickevent of the button
saveBusinessExpections() i want to call a asp.net function GetData() and FillAccountaValue() simultaneously.
I can't write a Serverside event directly for this controls, if i do this operation directly in serverside control, it will filter all the data and get the records from DB and it is very time consuming and i can't use AJAX controls here too, its not allowed here.
Please someone help me on this.
|
|
|
|
|
Yes possible, set function attribute as Webmethod
Parwej Ahamad
|
|
|
|
|
In my asp.net application I have grid view with some data.I need to pass those grid view's values to Details View and make some updation on that Details View.please give me simple example.
Thanks In Advance
|
|
|
|
|
I'm a complete novice in ASP.NET. My company is using 3.5. Here's my dilemma. I'm using VB
I'm using User.Identity.Name to pull in the user ID of the user on the Page_Load. I then want to take that User ID and bump it against a SQL Server view's column to see if it exists within the view (alongside other conditions). And there in lies my issue.
|
|
|
|
|
|
I'm doing this in VB. Looks like all the syntax is completely different.
|
|
|
|
|
If you really look closely you will notice there is not that much difference in the syntax, except C# is not as verbose and uses ;
Very few VB developers take the time to read other languages. It would benefit your career to do so.
Failure is not an option; it's the default selection.
|
|
|
|
|
Hi,
How to encrypt a uploaded file and save it in the server and how to download it as actual file.
eg: Upload a .docx file to server and save it as an encrypted file. When download it, it shall be download as .docx file.
Thankyou
|
|
|
|
|
Encryption uploaded files name, if Encryption a .docx file ,it's tried too
|
|
|
|
|
hello to all,
i am in a crisis, the deadline for submitting my asp.net website as major project is approaching and i am stuck at a critical stage. plz provide me with a solution asap.
PROBLEM: i have a registration form made up through external css, which i have included in the project files. the form is a sliding jquery form and i had removed the input data fields provided in original html markup (that came with the css and jquery files) and inserted the standard controls, such as textboxes, labels etc. for entering email id, pasword etc. Now, when i refer to these controls in codefile (default.aspx.cs), it shows error that these controls do not exist in the current context. I have checked the ids of controls and the inherit class, everything is correct, i don't get it why the debugging is hindered.
|
|
|
|
|
sqlds1.InsertCommandType = SqlDataSourceCommandType.Text;
sqlds1.InsertCommand = "insert into Network (States,LGA,Glo,MTN,Airtel,Etisalat,Multilinks,Starcomms,Visafone,Zoom_mobile,Remarks)values(@countryList,@stateList,@greencom,@mtngsm,@airtel,@etisalat,@multilinks,@starcomms,@visafone,@zoomm,@remarks)";
sqlds1.InsertParameters.Add("countryList", countryList.Text);
sqlds1.InsertParameters.Add("stateList", stateList.Text);
sqlds1.InsertParameters.Add("greencom", greencom.Text);
sqlds1.InsertParameters.Add("mtngsm", mtngsm.Text);
sqlds1.InsertParameters.Add("airtel", aritel.Text);
sqlds1.InsertParameters.Add("etisalat", etisalat.Text);
sqlds1.InsertParameters.Add("multilinks", multilinks.Text);
sqlds1.InsertParameters.Add("starcomms", starcomms.Text);
sqlds1.InsertParameters.Add("visafone", visafone.Text);
sqlds1.InsertParameters.Add("zoomm", zoomm.Text);
sqlds1.InsertParameters.Add("remarks", remarks.Text);
sqlds1.Insert();
Above is my snippets but its giving me compile Err. CS0103: The name 'greencom' does not exist in the current context
|
|
|
|
|
I think you are missing something while you are adding parameter to your sqlparameter.
use the below link[^], it will help you in clearing your boubts.
|
|
|
|
|
"insert into Network (States,LGA,Glo,MTN,Airtel,Etisalat,Multilinks,Starcomms,Visafone,Zoom_mobile,Remarks)values
this sql not't greencom filed, eg::
sqlds1.InsertCommandType = SqlDataSourceCommandType.Text;
sqlds1.InsertCommand = "insert into Network (States,LGA,Glo,MTN,Airtel,Etisalat,Multilinks,Starcomms,Visafone,greencom,Zoom_mobile,Remarks)values(@countryList,@stateList,@greencom,@mtngsm,@airtel,@etisalat,@multilinks,@starcomms,@visafone,@zoomm,@remarks)";
sqlds1.InsertParameters.Add("countryList", countryList.Text);
sqlds1.InsertParameters.Add("stateList", stateList.Text);
sqlds1.InsertParameters.Add("greencom", greencom.Text);
sqlds1.InsertParameters.Add("mtngsm", mtngsm.Text);
sqlds1.InsertParameters.Add("airtel", aritel.Text);
sqlds1.InsertParameters.Add("etisalat", etisalat.Text);
sqlds1.InsertParameters.Add("multilinks", multilinks.Text);
sqlds1.InsertParameters.Add("starcomms", starcomms.Text);
sqlds1.InsertParameters.Add("visafone", visafone.Text);
sqlds1.InsertParameters.Add("zoomm", zoomm.Text);
sqlds1.InsertParameters.Add("remarks", remarks.Text);
sqlds1.Insert();
|
|
|
|
|
Sqlds.InsertCommandType = SqlDataSourceCommandType.Text;
Sqlds.InsertCommand = "insert into Population(States,LGA,Males,Females,Bothsexes,Landsize,Terrain,Remarks) values (@countryList,@statelist,@male,@fmale,@bsexes,@landsize,@terrain,@remarks)";
Sqlds.InsertParameters.Add("countryList",countryList.SelectedValue);
Sqlds.InsertParameters.Add("stateList", stateList.SelectedValue);
Sqlds.InsertParameters.Add("male", male.Text);
Sqlds.InsertParameters.Add("fmale", fmale.Text);
Sqlds.InsertParameters.Add("bsexes", bsexes.Text);
Sqlds.InsertParameters.Add("landsize", landsize.Text);
Sqlds.InsertParameters.Add("terrain", terrain.Text);
Sqlds.InsertParameters.Add("remarks", remarks.Text);
Sqlds.Insert();
I am having problem with my dropdownlist, Its not inserting selected values into database only the first value on the list that is inserted into the db.
Here is the varable for it.
Sqlds.InsertParameters.Add("stateList", stateList.SelectedValue);
|
|
|
|
|
Which event you have written above code?
|
|
|
|
|
solution:
public void Page_Load()
{
stateList.AutoPostBack = true;
}
|
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
u code
}
}
|
|
|
|
|
That's right.
Another Convenience way:
You would Config AutoPostBack in the Property windows of the Dropdownlist.
|
|
|
|
|
|
|
you are picking the only SelectedValue of dropdownlist, put this thing in foreach or for loop that moves till the items.count is maximum.
- Happy Coding -
Vishal Vashishta
|
|
|
|
|
I want to use file upload in my website, without using file upload control.
I have used an asp textbox & an asp button. On clicking the button, the path of the file to be uploaded, comes in text box.
Now, how can I upload the file whose path is there in the text box.
Code that I used till now for button click is given below:
protected void btnUpload_Click(object sender, EventArgs e)
{
OpenFileDialog fdlg = new OpenFileDialog();
fdlg.Title = "C# Corner Open File Dialog";
fdlg.InitialDirectory = @"c:\";
fdlg.Filter = "All files (*.*)|*.*|All files (*.*)|*.*";
fdlg.FilterIndex = 2;
Thread stathread = new Thread(new ThreadStart(() => fdlg.ShowDialog()));
stathread.SetApartmentState(ApartmentState.STA);
stathread.IsBackground = true;
stathread.Start();
stathread.Join();
txtUpload.Text = fdlg.FileName;
}
modified 17-May-12 5:33am.
|
|
|
|
|
u used
OpenFileDialog ,you select file,but u don't loadup the file,you'll used file class, filecopy to you setting path.
InitialDirectory = @"c:\";
|
|
|
|
|