|
Sonia Gupta wrote: i can't use the respose.redirect function in class file.
You can use that by HttpContext.Current.Response.Redirect()
Sonia Gupta wrote: Is there any inbuilt function to perform this task.
Nope. Inherit all your pages from a base class and do the checking there. You can override OnInit or Page_load in this class and do the checking.
|
|
|
|
|
suppose in the address bar i am manually writing to access a particular page without log in , from there , it is Being navigated to the login page,after logging in , can i find which page i was trying to access ?
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
|
|
|
|
|
Yes it can be done by setting the requested page to a cookie.
|
|
|
|
|
i have a dataset , which contains 120 rows in the table.
Is there any way to upload the rows at once , without comming back to client an then going back to server 120 times ?
The database is SQL Server
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
|
|
|
|
|
Dataadapter provides Bulk update.
adapter.Update(dataSet);
/***********************/
Parwej Ahamad
g.parwez@gmail.com
/***********************/
|
|
|
|
|
Sonia Gupta wrote: without comming back to client an then going back to server 120 times ?
? If you put a loop and execute it, it won't come back to the client. Or use adapter.Update() .
|
|
|
|
|
can i use the pameterized queries while using the adapter.update ?
I am saying this because , i am doing the duplicacy checks while inserting the records.
while populating the Datatable with rows , that time too i am using doing the duplicacy check.except one thing like
i have master table and child table
in master table i have name field and id
and in child table i have subject field and master table id
so the data is of following type
Sonia Maths
Sonia English
Sonia Physics
....
....
in the datatable.
so subject are comming under Sonia
on the subject i am putting the duplicacy check but the check on name will be done at the back end , reason is , the moment i insert the first record of Sonia it will insert the name in the master table and the pertaining suject in the child table ,
then the next record should come under the same id (and it will pick the soina id and will insert the record under that id of Sonia.) , i mean under sonia.
That's the reason i am checking the name dupicacy at back end
Now my question is how i should use the parameterized queries(in order to use the stored procedures) while using the adapter.update.
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
|
|
|
|
|
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment; filename=" +
file.Name);
Response.AddHeader("Content-Length", file.Length.ToString());
Response.ContentType = "application/octet-stream";
Response.End();
By this code we get download dialog box.There are three buttons
cancel,open and save. How to find out whether user had pressed cancel or
open/save.
|
|
|
|
|
Can you tell me why you need to trap the these buttons ?
/***********************/
Parwej Ahamad
g.parwez@gmail.com
/***********************/
|
|
|
|
|
actually i want to log in the database that the file is downloaded or opened and not if it is cancelled. Please if you have any ideas pls let me know.
|
|
|
|
|
I'm building Social web site based on ASP.NET
I just want to upload video files to server and play these video files.
but i knew 2 uploading methods : to sql server , to server system.
the size of video file is usally 10MB.
What is better?
|
|
|
|
|
So, store paths to the files in SQL Server, and the videos on the file system.
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 )
|
|
|
|
|
Heracles Choe wrote: but i knew 2 uploading methods : to sql server , to server system.
the size of video file is usally 10MB.
What is better?
It depends on you and your requirements.
Performance:
* File System - Good
* SQL Server - Not good
Maintenance
* File System - Difficult to maintain
* SQL Server - Very Easy
I also heard about Video Servers which faster for videos. If you have still time to R&D just research on Video Servers also.
|
|
|
|
|
Hello, I am developing a webform, which when submitted emails the form and/or fields as word attachment. To generate the web form as word document I have used C# as below:
System.IO.StringWriter oStringWriter = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter oHtmlTextWriter = new HtmlTextWriter(oStringWriter);
StreamWriter objStreamWriter = File.AppendText(strFilepath);
Panel1.RenderControl(oHtmlTextWriter);
objStreamWriter.WriteLine(oStringWriter.ToString());
objStreamWriter.Close();
Using smtpdotnet, I am emailing this word attachment. The problem is that the word document generated does not look straight. Fields are not properly aligned and margins are messed up with the result that the print-out does not even print the entire document. Can you suggest if there is a better approach to the solution above to render a clean-looking word document? Would you recommend any third party tools or components for ASP.NET 2.0? Any help is appreciated. Thanks.
|
|
|
|
|
tjkota wrote: To generate the web form as word document I have used C#
Even though you generate the Word file using the HTML tags, it is not the actual Word file. Rather I can call it HTML Word file.
tjkota wrote: The problem is that the word document generated does not look straight. Fields are not properly aligned and margins are messed up with the result that the print-out does not even print the entire document.
The problem may be your stylesheet. Are you using any stylesheet for the HTML/ASPX page to render properly?? If so when you save it as Word file, the Css references would miss. May be this is your problem. To solve this problem,
* Inject the styles you used in the page, in the same page itself using tags
or
* Change the Css reference to the full path (http://www.mydomain.com/css/mycss.css) rather using than partial relative path (css/mycss.css). This idea work well only when you able to connect to www.mydomain.com at all time.
|
|
|
|
|
hi Venkatesh, Thanks for your suggestions. I replaced the stylesheet references with inline style and that took care of fonts etc however the columns widths are still disturbed (i am not using stylesheets for this). Also text that is entered in textarea does not show on the html word doc, although text from input text boxes shows. Any advise on this? Thanks, Teja
|
|
|
|
|
tjkota wrote: I replaced the stylesheet references with inline style and that took care of fonts etc however the columns widths are still disturbed (i am not using stylesheets for this).
This can be acheived only by styles. Apply some style to fix the width of the column and try to export.
|
|
|
|
|
Good day.
How can I check in aspx whether or not the combobox is checked or not before the page gets posted back? I tried using a requiredFieldValidator, but apparently I cannot use that validation control with comboboxes?
|
|
|
|
|
You can write a custom validator in javascript.
By checked I assume you mean, a value has been selected. The best way IMO is for it to start with a default selection.
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 there i'm using file upload control to upload files to the server
but i'm asking how to rename these file which the user specify to upload becuase there are some users write a very long file name
is there is any solution
thanks
|
|
|
|
|
After you upload, you can use PostedFile.SaveAs wherein you can give a filename of your choice.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
I have a crystal report which was running fine but now gives me an error about logon failed and it highlights the following line:
oStream = crpt28.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat)
Here is the code I am using:
Imports System.Web.Security
Imports System.Data.SqlClient
Imports System.DateTime
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Dim crpt28 As CrystalReport28
Dim crpt28 As CrystalReport28
Dim myTable As CrystalDecisions.CrystalReports.Engine.Table
Dim myLogin As CrystalDecisions.Shared.TableLogOnInfo
Dim Param As SqlParameter
Dim SqlCom As SqlCommand
Dim sqlcon As New SqlConnection("Data Source=server;database=data;user id=user;password=pass")
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
crpt28 = New CrystalReport28
For Each myTable In crpt28.Database.Tables
myLogin = myTable.LogOnInfo
myLogin.ConnectionInfo.Password = "kris"
myLogin.ConnectionInfo.UserID = "kris"
myTable.ApplyLogOnInfo(myLogin)
Next
CrystalReportViewer1.ReportSource = crpt28
Dim oStream As New System.IO.MemoryStream
oStream = crpt28.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat)
Response.Clear()
Response.Buffer = True
Response.ContentType = "application/pdf"
Try
Response.BinaryWrite(oStream.ToArray())
Response.End()
Catch err As Exception
Response.Write("< BR >")
Response.Write(err.Message.ToString)
End Try
crpt28.Close()
crpt28.Dispose()
crpt28 = Nothing
End Sub
|
|
|
|
|
macca24 wrote: oStream = crpt28.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat)
Your db credentials that are being used are correct?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
|
Hi all,
I am using asp.net2.0 , C# and sql server 2005.
When i fill the dropdownlist with two color based on contdtion in recordset it fill successfully but on seletedindex _change those color vanish but record remains.
how can i persist data with color ?
the code i used to fill the data is
foreach (DataRow row in dtcompany.Rows)
{
if (row["HM_TRG_FLAG"].Equals(true) )
{
ListItem item = new ListItem(row[1].ToString(), row[0].ToString());
// item.Attributes.Add("Tooltip", row[1].ToString());
item.Attributes.Add("style", "color:GREEN");
ctrl.Items.Add(item);
//ctrl.Items.Add(new ListItem(ctrl.Items.Add(item);, row[0].ToString()));
}
else
{
ListItem item = new ListItem(row[1].ToString(), row[0].ToString());
// item.Attributes.Add("style", "color:RED");
item.Attributes.Add("Tooltip", row[1].ToString());
ctrl.Items.Add(item);
}
}
regards
imran khan
|
|
|
|