|
Use HttpContext.Current.Response . Always check HttpContext.Current for NULL.
|
|
|
|
|
You need to inherit the System.Web.UI.Page Class
Ex:
Public Class MyClassName : System.Web.UI.Page
---Your code
End Class
|
|
|
|
|
Shaik Haneef wrote: You need to inherit the System.Web.UI.Page Class
This is potentially one way to achive the desired result, but you by no means need to inherit from this class to obtain a reference to the current Http Context.
|
|
|
|
|
Dear Friends,
Thanks for the different type of helps in time to time matter,
Currently i am working on an project in which i am storing different type of extension document in sql database at column with data type "image" all working properly. but today i found an bug in it that if i am trying to open any html file it is open in same browser where my web applcation is running......
Is it possible to open that file to different browser?
Please help me regard this.
Thanks in advanced.
My code to open the stored doc is as beow
Code: C#
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment; filename=<filename>" + <file extention="">);
Response.ContentType = "application/octet-stream";
Response.BinaryWrite(<byte array="" of="" the="" file="">);
Response.End();</byte></file></filename>
Sasmi
|
|
|
|
|
Put a link which has a target as _BLANK and it will open this page in a new window.
Sasmi_Office wrote: with data type "image
Future SQL server versions won't support this datatype. If possible change this to VarBinary(MAX)
|
|
|
|
|
I don't understand where to put the link which has a target as _BLANK, because the response object directly opening the page retrieved from the sql database as mention in my above code..
Sasmi
|
|
|
|
|
Hello,
Friends
I am using Mysql ( version 5.0) as database and C# for programming the page. I am unable to store the date value into the DB i tried with converting the datetime value to yyyy-MM-dd still i get 0000-00-00 in the database.
and at the time of getting back the data a error is thrown
" unable to convert mysql datetime to system datetime "
Please if anyone knows how to solve this issue please let me know
Thanks and Regards
Krazy programmer
If You win You need not Explain............
But If You Loose You Should not be there to Explain......
|
|
|
|
|
Use date format:
<br />
DATE_FORMAT(DateValue, '%yyyy/%mm/%dd')
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
thanks for the response i tried with it
Now it is storing NULL
If You win You need not Explain............
But If You Loose You Should not be there to Explain......
|
|
|
|
|
Try
convert(datetime, @date,103)
|
|
|
|
|
Does anybody guide me how to transfer data from DataTable to Excel
|
|
|
|
|
Try a google search.[^]
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
Try Using Stream Reader and Writer.......
|
|
|
|
|
you've to iterate through dt row by row
try the following;
---------------------------------------
Respone.Clear();
Response.AddHeader("content-disposition", "attachment;filename=FileName.xls");
Response.ContentType="application/.xls";
foreach(dataRow row in dt.Rows)
{
Response.Write(" ");
Response.Write(row[0]+" "+row[1]);
}
Response.End();
-----------------------------------------
customize you code while writting it into Response's Write method, I gave you a fair example, play with it
|
|
|
|
|
|
HI
can any one provide me the list of allowed html tags supported by crystal reports in visual studio 2008 ?, thankx in advance.
|
|
|
|
|
|
How to use HTML Tag in Crystal report.
already html tag is available in my database. i want to use that tag as work in HTML file.
|
|
|
|
|
i tried to load a HTML file using crystal report with the following content
<table border="1" cellpadding="2" cellspacing="0">
<tr>
<td>column 1</td>
<td>column 2</td>
<td>column 3</td>
</tr>
<tr>
<td>value 1</td>
<td>value 2</td>
<td>value 3</td>
</tr>
<tr>
<td>value 1</td>
<td>value 2</td>
<td>value 3</td>
</tr>
</table>
but the content was shown without table formatting
How can i get in table format with cellpadding and cellspacing
pls help me
|
|
|
|
|
hi All
I have some global variable and function in cs file of a aspx page
it it possible to write c# code in aspx file to use that variable
................................
means all i need is how to write c# function and variable under a asp tag
|
|
|
|
|
Its confusing are you trying to say inline coding ?
pratik malviya wrote: means all i need is how to write c# function and variable under a asp tag
can you little bit elaborate the question ?
What are you trying to do ?
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
Check My Blog
|
|
|
|
|
i want to use function which is written in aspx.cs file.
suppose i write a function "public string labeltext()" in aspx.cs file
now in aspx file i want to use that function to assign the text to label1
i heard that it is possible that we can use functions of aspx.cs file in aspx file by the help of <% %> i tried this but getting some error
plese any body can semd me an example of that on pratikmalviya@gmail.com
|
|
|
|
|
Label.Text="<%=labeltext()%>
or have string varaible in the class assign your function string value it
and put this string varaible in the aspx
string StringVarabile;
StringVarabile=labeltext();
Label.Text="<%=StringVarabile%>
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
Check My Blog
|
|
|
|
|
I tried For Your Problem It's Working Fine Man, I think Problem with your codeing You just try this one by taking the new aspx Page. You just put the function in <% ExFunction() %>
Default2.aspx
************
]]>
<title>Untitled Page
<%
myfun();
%>
Default2.aspx.cs :
******************
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
public void myfun()
{
Response.Write("working");
}
}
|
|
|
|
|
try using like this
<%=myfunct()%>
T.Balaji
|
|
|
|