|
|
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
The file name and path to be uploaded is stored in a session variable. In the code behind I would like to have a method that uploads this file.
|
|
|
|
|
dptalt wrote: The file name and path to be uploaded is stored in a session variable.
From where these file name will come to session variable ?
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
dptalt wrote: it requires the user to click the browse button to select a file.
Yes It should be !
dptalt wrote: Can't I programatically set the file to be uploaded? Or is there another way to do this?
Is it a fix file ? If yes, you can try it using ActiveX Components. But it will work only on IE.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
That would violate just a few security protocols. Just imagine the risks if browsers just allowed websites to upload documents to the server without user input.
|
|
|
|
|
Jokes apart. Its not possible.
There is no possibility to have input type="file" control to set the value without human intervention. Even you cannot copy the input type="file" control.
Thus if you create a dynamic form and copy the control to that form and send.. it wont be possible. So forget about this..
Moreover you can do one thing, is to programmatically open the File browser dialog...
|
|
|
|
|
hi
what is the requirement for connect to Microsoft SQL database using asp.net like (any connectors for mssql) please
guide me .
|
|
|
|
|
I hope you have access ot Google[^]
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
In my application i want to store all the queries in a text file instead of the code behind and at run time i want to call it from the code behind page.can it be possible.If yes then how??
|
|
|
|
|
Very Bad Practise that is Vulnerable to SQL injection. i dont know why dont you let SQL do the SQL and ASP.nET do the ASP.NET PArt.
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Of course its possible, all you are doing is reading a file - just make sure its located in an accessible directory. take a look at the SYSTEM.IO namespace.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
souravghosh18 wrote: store all the queries in a text file
How about storing them in the database, like as Stored Procedures
only two letters away from being an asset
|
|
|
|
|
This is the code for the login.aspx
<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="Login.aspx.vb" Inherits="_Default" title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:LoginView ID="LoginView3" runat="server">
<LoggedInTemplate>
Welcome back.
</LoggedInTemplate>
<AnonymousTemplate>
<asp:Login ID="Login1" runat="server" BackColor="#F7F6F3" BorderColor="#E6E2D8"
BorderPadding="4" BorderStyle="Solid" BorderWidth="1px"
DestinationPageUrl="~/Login.aspx" Font-Names="Verdana" Font-Size="0.8em"
ForeColor="#333333">
<TextBoxStyle Font-Size="0.8em" />
<LoginButtonStyle BackColor="#FFFBFF" BorderColor="#CCCCCC" BorderStyle="Solid"
BorderWidth="1px" Font-Names="Verdana" Font-Size="0.8em" ForeColor="#284775" />
<InstructionTextStyle Font-Italic="True" ForeColor="Black" />
<TitleTextStyle BackColor="#5D7B9D" Font-Bold="True" Font-Size="0.9em"
ForeColor="White" />
</asp:Login>
</AnonymousTemplate>
</asp:LoginView>
</asp:Content>
And the name of the database created by the security in ASP.NET is ASPNETDB.MDF
|
|
|
|
|
Merge The Database(security) to Your Using Database and Change the Connection String of aspnetdb by default( ) In Web.config file .If This Is not ur Answer Sorry..!
If It Helps Click It as Answer
|
|
|
|
|
You can re-create the schema for the ASPNETDB in your own database and then specify your database in the connectionstring in your web.config.
To create the schema in your own DB go to command prompt and go to c:\Windows\Microsoft.NET\Framework\v2.0.50727. When you are at this directory type aspnet_regsql and hit enter. A window will show a wizzard that will take you through the steps of selecting your database and then it will create the schema for you.
All you have to do now is add a connectionstring to your web.config file that points to this database.
Now that you know where the database resides, you can now proceed to move it to the host server where you want to deploy it. The most effective way for me is to right click the database in SQL explorer and select Generate Script.
When you have the script you can just ask one of the admin guys at your hosting company to run and attach the db and you are all done!
Enjoy!
Illegal Operation
|
|
|
|
|
Hi
I need to create a webpage which inputs an url which the web page would process and provide some result to the user.
Sending an HTTP Request from my server to any other server and getting the response - this is where I need help.
Sample code or which ASP.Net classes to use would sufficiently be of great help.
Thanks in Advance
Sean
|
|
|
|
|
Sean Cleetus wrote: Sending an HTTP Request from my server to any other server and getting the response
They Should also Give Response To Ur Server If thts the Case Then Ok
If U R Working With Third Party Then They Have A interface /Or the Coding Methods to Follow
The Below Code Was Used By Me For Credit card Authentication Which Innvolves Both
IT May Help..!
private string CreditCardCheck(decimal bidamount)
{
string relayResponse = GeneralSettings.CreditCardRelayResponse;
string creditCardTestRequest = GeneralSettings.CreditCardTestRequest;
string creditCardDelimData = GeneralSettings.CreditCardDelimData;
string TrasactionId = "";
String result = "";
string expDate = "";
expDate = DropDownMonth.SelectedItem.Text + DropDownYear.SelectedItem.Text;
String strPost = "x_login=" + loginID + "&x_tran_key=" + trans_Key + "&x_method=CC&x_type=AUTH_ONLY&x_amount=" + bidamount + "&x_delim_data=" + creditCardDelimData + "&x_delim_char=|&x_relay_response=" + relayResponse + "&x_card_num=" + TextBoxCreditCardNo.Text + "&x_exp_date=" + expDate + "&x_test_request=" + creditCardTestRequest + "&x_version=3.1" + "&x_first_name=" + TextBoxCardholder.Text + "&x_last_name=" + TextBoxCardholderLastName.Text + "&x_company=" + TextBoxCompany.Text + "&x_address=" + TextBoxAddress.Text + "&x_city=" + TextBoxCity.Text + "&x_state=" + StatesDropDownlist.SelectedItem.Text + "&x_zip=" + TextBoxZipCode.Text + "&x_country=" + TextBoxCountry.Text + "&x_phone=" + TextBoxPhone.Text + "&x_fax=" + TextBoxFaxl.Text + "&x_email=" + TextBoxEMail.Text;
StreamWriter myWriter = null;
string url ="https://secure.authorize.net/gateway/transact.dll";
HttpWebRequest objRequest = (HttpWebRequest)WebRequest.Create(url);
objRequest.Method = "POST";
objRequest.ContentLength = strPost.Length;
objRequest.ContentType = "application/x-www-form-urlencoded";
try
{
myWriter = new StreamWriter(objRequest.GetRequestStream());
myWriter.Write(strPost);
}
catch (Exception ex)
{
logger.Error(ex.Message);
}
finally
{
myWriter.Close();
}
HttpWebResponse objResponse = (HttpWebResponse)objRequest.GetResponse();
using (StreamReader sr =
new StreamReader(objResponse.GetResponseStream()))
{
result = sr.ReadToEnd();
string[] responsedetails = result.Split('|');
TrasactionId = responsedetails[6].ToString();
sr.Close();
}
if (result.ToLower().Contains("invalid") || result.ToLower().Contains("inactive"))
{
return "CreditCardis notvalid";
}
return TrasactionId ;
}
If It Helps Click It as Answer
|
|
|
|
|
Thanks you very much Sashidhar. This is exactly what I was looking/hoping for
|
|
|
|
|
Its Ok ..! Any Time..!
If It Helps Click It as Answer
|
|
|
|
|
I appreciate your effort. But few things to consider while replying,
1) Post only relevant code. The code posted by you has a lot of unwanted stuff.
2) Avoid using SMS language[^]. It is hard to read.
|
|
|
|
|
Ok Thx For Ur Suggestion I will Do From Next Time..!
If It Helps Click It as Answer
modified on Wednesday, September 23, 2009 7:37 AM
|
|
|
|
|
Most easy way to get a response from a URI is to use WebClient[^] class.
|
|
|
|
|
In perticular date the main report have record but subreport have no record.In this situation the subreport retrieve all the data from table.
How to supress sub report when this situation. Please help me..........
|
|
|
|
|
I think Here U Will Not Get Most Help For reports Questions I suggest U to Post In General DataBase Or Different Forums .I am Telling U this With My Own Experience..!
If It Helps Click It as Answer
|
|
|
|