|
Thank you i will try it
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
Hi,
I am developing an application which needs, to open the file in the browser, the file can be of any type (i.e.) Word Document or excel sheet or Jpeg image or any thing
Can any one suggest some mechanism to do this.
I am developing ASP.Net web application with VB.Net
Thanks in advance
|
|
|
|
|
Hi,
you can do Reponse.Redirect("full Path of file")
So it will open file in browser.
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|
|
But the browser will only open those file types that it can support within itself. If you try to, for example, open a .cs file, it will open outside the browser.
|
|
|
|
|
Friends,
My cookies value gets reset between every two or three redirect between pages. The cookie value does not reset in mozilla or some version of IEs.
So the problem is not with the code. I have checked everything in IE options also . Wat might be the problem?
|
|
|
|
|
hi everybody,
i just want da info regarding how to write a code when a button is clicked.i hav a few textboxes and some buttons.a letter is to be displayed in textbox where the cursor is focussed when a button containig a text is clicked.for ex if i click button A,then a is to be displayed in textbox.
please help me out.
thankyou...
|
|
|
|
|
Hi,
its realy very simple question
try below code on ButtonClick event.
Double click on button.
Textox1.Text = ButtonA.Text;
Write this code on every button click, just change Button...
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|
|
Do you want this to happen immediately, or for the page to post back ? If the former, you need to write javascript to run when the button is clicked, to find the textbox control and put text in it.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi
Does anyone know if using SSL is the best method to provide a secure connecion between SQL Server and a Web Server?
cheers
|
|
|
|
|
Hi all,
I sit with an issue and have absolutely no idea why it is happening.
I have a DropDownList, as follow:
<asp:dropdownlist id="ddlPaymentMethod" runat="server" onselectedindexchanged="ddlPaymentMethod_SelectedIndexChanged">
</asp:dropdownlist>
Then in the code-behind I have the following:
protected void ddlPaymentMethod_SelectedIndexChanged(object sender, EventArgs e)
{
if (ddlPaymentMethod.SelectedIndex.ToString() != "")
{
SetDivVisibility(ddlPaymentMethod.SelectedItem.Value.Trim());
}
}
But for some reason, when I run the program, and change the value within the DropDownList, it never enters the SelectedIndexChanged event.....
Any ideas or solutions would be greatly appreciated
Thanks in advance
No matter how long he who laughs last laughs, he who laughs first has a head start!
|
|
|
|
|
Hi,
set property AutoPostBack = True in Dropdown list...
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|
|
Thanks, working like a dream now.
No matter how long he who laughs last laughs, he who laughs first has a head start!
|
|
|
|
|
Hi
I currently use Visual Web Developer 2005 Express Edition to write .net and c# code.
Does anyone know of any problems with uploading files from Visual Wev Developer to a web server?
cheers
|
|
|
|
|
is there any specific problem that your are facing????
|
|
|
|
|
No I havent encountered any problems.
The reason I ask it because I am currently using VWD to upload to a citrix server and wondered if there was any problems with uploading to a web server?
cheers
|
|
|
|
|
I have a requirement.I have a user control in which based on the enum selection I need to add textbox or combobox at design time.For example if enum value = 0 then textbox should be added in usercontrol - if enum = 1 them combobox should be added.The changing of enum value will be done from form1.Means the
blank user control will be droped on the form.From that from I will change the enum value.Based on that
the control should be created.and the controll should hold all its properties.
Can any body help me for this.
|
|
|
|
|
Hello EveryOne
I want to use Excel file into my web project.So I add reference and use it.
It is run properly into My localHost but when I upload this site into my web server it is not running properly.
And showing following error :
“Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80040154”
And My method is following which is create the Excel Sheet.....
private void createDataInExcel(DataTable dt)
{
Excel.Application oXL;
Excel._Workbook oWB;
Excel._Worksheet oSheet;
Excel.Range oRng;
string strCurrentDir = Server.MapPath(".") + "\\reports\\";
try
{
oXL = new Excel.Application();
oXL.Visible = false;
oWB = (Excel._Workbook)(oXL.Workbooks.Add(System.Reflection.Missing.Value));
oSheet = (Excel._Worksheet)oWB.ActiveSheet;
int intdsCount = dt.Rows.Count;
int iRow = 2;
if (dt.Rows.Count > 0)
{
for (int j = 0; j < dt.Columns.Count; j++)
{
string a = dt.Columns[j].ColumnName;
oSheet.Cells[1, j + 1] = dt.Columns[j].ColumnName;
}
// For each row, print the values of each column.
for (int rowNo = 0; rowNo < dt.Rows.Count; rowNo++)
{
for (int colNo = 0; colNo < dt.Columns.Count; colNo++)
{
oSheet.Cells[iRow, colNo + 1] = dt.Rows[rowNo][colNo].ToString();
}
iRow++;
}
}
oSheet.get_Range("A1", "IV1").Font.Bold = true;
oRng = oSheet.get_Range("A1", "IV1");
oRng.EntireColumn.AutoFit();
oXL.Visible = false;
oXL.UserControl = false;
FileInfo[] files=new DirectoryInfo(Server.MapPath("~\\Admin\\reports\\")).GetFiles("*.xls");
check_login();
string strUserName = Session["UserName"].ToString();
string strFile = String.Concat(strUserName, "_" , "report" , System.DateTime.Now.Ticks.ToString() , ".xls");
foreach(FileInfo fi in files)
{
string[] arrFileInfo = fi.ToString().Split('_');
if (arrFileInfo[0].ToString() == strUserName)
{
if (fi.ToString().Trim() != strFile)
{
fi.Delete();
}
}
}
oWB.SaveAs(strCurrentDir + strFile, Excel.XlFileFormat.xlWorkbookNormal,
null, null, false, false, Excel.XlSaveAsAccessMode.xlShared, false, false, null, null, null);
oWB.Close(null, null, null);
oXL.Workbooks.Close();
oXL.Quit();
System.Runtime.InteropServices.Marshal.ReleaseComObject(oRng);
System.Runtime.InteropServices.Marshal.ReleaseComObject(oXL);
System.Runtime.InteropServices.Marshal.ReleaseComObject(oSheet);
System.Runtime.InteropServices.Marshal.ReleaseComObject(oWB);
string displayScript = "<script language='javascript'>" +
" winOpen('ExcelSheet.aspx?ExcelFile=" + strFile + "')" +
" </script>";
Page.RegisterStartupScript("PopupScript", displayScript);
}
catch (Exception theException)
{
Response.Write(theException.Message);
}
}
Thnax and regards
Deepak
Smile a Lots,Its Costs Nothing
|
|
|
|
|
Hi,
I want to develop a comparison chart. For example,
You want to start a new restaurant in a particular place. So, what you do is you will list all the items that are being supplied by the restaurents already available on X-axis and all the restaurents on Y-axis.
Now you put a tick mark against each item taking one restaurent at a time.
item1 item2 item3 item4
Rest1 . .
Rest2 . . .
Rest3 . .
My report should look something like this and i am working in asp.net 1.1
Thank You in advance
Thank you
|
|
|
|
|
|
Hi,
This is from Chandrakanth.
Now i am uploading Image in to Sqlserver2005.
I have written coding like this using Enterprise Library
protected void btnUpload_Click(object sender, EventArgs e)
{
if (upXLTalisma.PostedFile != null)
{
if (upXLTalisma.PostedFile.ContentLength > 0)
{
HttpPostedFile objHttpPostedFile = upXLTalisma.PostedFile;
if (CheckValidFileType(objHttpPostedFile.FileName))
{
int intContentlength = objHttpPostedFile.ContentLength;
byte[] bytImage = new byte[intContentlength];
objHttpPostedFile.InputStream.Read(bytImage, 0, intContentlength);
KF.Search.StoreImage(Convert.ToByte(bytImage));
}
}
}
}
public static bool CheckValidFileType(string strImage)
{
string strImageFile;
strImageFile = strImage;
if (strImageFile.LastIndexOf(".") == -1)
return (false);
int i = strImageFile.LastIndexOf(".");
strImageFile = strImageFile.Substring(strImageFile.LastIndexOf(".") + 1);
return (strImageFile.ToUpper() == "JPG");
}
This is the code i am using in Class file
public static void StoreImage(byte strImage)
{
try
{
Database objDataBase = DatabaseFactory.CreateDatabase();
DbCommand objDbCommand = objDataBase.GetStoredProcCommand("STP_KF_IMages");
objDataBase.AddInParameter(objDbCommand, "@Image", DbType.Binary, strImage);
objDataBase.ExecuteNonQuery(objDbCommand);
}
catch (Exception Ex)
{
throw new Exception(Ex.Message.ToString());
}
}
but i am getting error in this line,
KF.Search.StoreImage(Convert.ToByte(bytImage));
and Saying
"Unable to cast object of type 'System.Byte[]'to 'System.IConvertible'. "
Can any one suggest me what to do for that coding.
Thanks And Regards
Chandrakanth
Chandrakanth
|
|
|
|
|
mrgaddam wrote: objHttpPostedFile.InputStream.Read(bytImage, 0, intContentlength);
Oops! The Read method returns the number of bytes actually read, which can be smaller than the number of bytes requested. If you ignore the return value of the method, you don't know how much of the data that you actually get.
You have to get the return value from the method to see how much data was read, and loop until you have read all of the data (you reach content length, or the method returns zero).
mrgaddam wrote: KF.Search.StoreImage(Convert.ToByte(bytImage));
You can't convert a byte array into a single byte.
mrgaddam wrote: public static void StoreImage(byte strImage)
This method takes a single byte as parameter. That is truly pointless as you can't store an image in a single byte. Change the method to take an array of bytes.
Using hungarian notaion to specify data type is rather pointless in a strongly typed language. And if you specify the wrong type, as you have here when you gave a byte variable a name that says that it's a string, it's only confusing.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
Hi,
Once again this is from Chandrakanth.
Can you please tell me what are all things have to follow in Code
Thanks and Regards
Chandrakanth
Chandrakanth
|
|
|
|
|
mrgaddam wrote: Can you please tell me what are all things have to follow in Code
I already did that.
Read my previous post, and if there is anything that you don't understand, say what it is.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
iam having only one text box which is useful to enter different datatype values say date,number,string etc now my requirement is the first data type is date datatype ..how i can check if the user enters some text in the text box is a valid date formate or not..if he enters other than date then how i can say that the value enter is not in date format
|
|
|
|
|
Hi jagadeeshkumar2106,
suppose u have a one textbox names text1 ok now try this code
// Code is here.
try
{
DateTime d = new DateTime();
d = Convert.ToDateTime(Text1.Text.Trim());
// If it will not be in proper format then it will throw an error ok
// if u know error type about converting then u can also write one another catch block regarding that.
}
catch(Exception ex)
{
Response.Write("Enter Date is not in valid format");
}
I hope it will work.
modified on Friday, December 14, 2007 7:14:25 AM
|
|
|
|