|
I want to pass a instance of object1 from page1 to the page2.
And set the object properties from page 2 and again send that object from page 2 to page 1.
I tried with session. unable to access the object in page 2.
CAN ANYONE TELL ME...
How to pass an instance of object from one page to other?
modified on Thursday, September 18, 2008 1:57 AM
|
|
|
|
|
can u use querystring to pass values.
or try to declare the objects in seperate .cs(class) file and access that objects in all pages
Ashok
|
|
|
|
|
yup I got it by using sessions . thank you
|
|
|
|
|
hi,
u keep it on session then explicity typecast the object as session in second page on right side u can access the object
T.Balaji
|
|
|
|
|
hi Friends Good Morning,
How to reduce time of copy through IO.copy method or any other solution.
There is any other method for fast copy excepted IO.
Please Help me.
Thanks
Piyush Vardhan Singh
p_vardhan14@rediffmail.com
http://holyschoolofvaranasi.blogspot.com
http://holytravelsofvaranasi.blogspot.com
|
|
|
|
|
Piyush Vardhan Singh wrote: How to reduce time of copy
Copy what? Please explain your question in detail so that we can understand what you are asking.
|
|
|
|
|
I am using
1:
(CopyDirectory(sourceFolder, destinationFolder).ToString())'"IO Class " f
2:
If Not System.IO.Directory.Exists(destinationFolder) Then
System.IO.Directory.CreateDirectory(destinationFolder)
End If
For Each fi As System.IO.FileInfo In folder.GetFiles
CopyFileEx(fi.FullName, destinationFolder & "\" & fi.Name, _copyProgressRoutine, 0, 0, 0)
_totalBytesCopied += fi.Length
Next
For Each di As System.IO.DirectoryInfo In folder.GetDirectories
CopyFiles(di, di.FullName.Replace(ROOTFOLDER, DESTFOLDER))
Next
for the copy data one place to another place. both work properly. but i want any other way to copy more than fast both function. it is possible.
Piyush Vardhan Singh
p_vardhan14@rediffmail.com
http://holyschoolofvaranasi.blogspot.com
http://holytravelsofvaranasi.blogspot.com
|
|
|
|
|
Hi I want to implement Caching in Web Service. I have written the following code but it is not working as expected,all the time it is giving fresh result(not cached result)
[WebMethod(CacheDuration=360)]
public string GetDate()
{
string s=DateTime.Now.ToString();
return s;
}
Please suggest
|
|
|
|
|
I need to display the following image in my webpage...
string imageStr = imageFromBase64( responseXMLfromUPS);
this.page.xxx = imageStr;
I have a base64 encoded string from UPS that I need to display on
my web page. Your assistance is appreciated.
Thank you for your help. signed... Linda
xxx
|
|
|
|
|
Depending on the format of the image (i.e. Header, BPP, RGB, RGBA, BGR, etc)
1) Get the size of the image.
2) Create a table
<table border="0" cellpadding="0" cellspacing="0">
3) For each row of the image
<tr>
4) For each col of the image
<td><div style="width: 1px; height: 1px; background-color: colorofthepixel;" /></td>
5) End the row
</tr>
6) End the table
</table>
Should be pretty good likeness.
- S
50 cups of coffee and you know it's on!
A post a day, keeps the white coats away!
|
|
|
|
|
hi friends,
iam unable to to export gridview content to pdf using itextsharp.
i surfed through the net but none of them worked for me if any of you provide me the code it would be a great help.
Thanks in Advance,
Praveen
|
|
|
|
|
hi there, I'm also looking into converting html to pdf via iTextSharp for the first time here. Just like to take this oportunity to ask you a question (as my VS is going thru an upgrade I havent been able to test this functionality). Are you using this way to convert simple HTML to PDF?
public static void CreatePDFDocument(String strFilePath, String strContent)
{
Document document = new Document(PageSize.A4, 80, 50, 30, 65);
try
{
PdfWriter writer = PdfWriter.GetInstance(document, new FileStream(strFilePath, FileMode.Create));
XmlTextReader reader = new XmlTextReader(new StringReader(strContent));
reader.WhitespaceHandling = System.Xml.WhitespaceHandling.None;
HtmlParser.Parse(document, reader);
}
catch (Exception e)
{
throw e;
}
}
|
|
|
|
|
hi,
pls use the code below and chnage it according to ur requirement.Ther grid im using is having 3 columns thats y ive given
iTextSharp.text.Table datatable = new iTextSharp.text.Table(3);
code
-----
using iTextSharp.text;
using iTextSharp.text.pdf;
public void export()
{
Document document = new Document(PageSize.A4, 0, 0, 50, 50);
System.IO.MemoryStream msReport = new System.IO.MemoryStream();
var fetchtest = from a in dc.SE_Tests
select new
{
a.Test_Code,
a.Test_Name,
a.Test_Credits
};
DataTable dt = ObtainDataTableFromIEnumerable((IEnumerable)fetchtest);
try
{
// creation of the different writers
PdfWriter writer = PdfWriter.GetInstance(document, msReport);
// we add some meta information to the document
document.Open();
iTextSharp.text.Table datatable = new iTextSharp.text.Table(3);
datatable.Padding = 2;
datatable.Spacing = 0;
float[] headerwidths = { 10, 10, 10};
datatable.Widths = headerwidths;
// These cells span 2 rows
datatable.DefaultCellBorderWidth = 1;
datatable.DefaultHorizontalAlignment = 1;
datatable.AddCell("Test_Code");
datatable.AddCell(new Phrase("Test_Name", FontFactory.GetFont(FontFactory.HELVETICA, 14, Font.NORMAL)));
datatable.AddCell("Credits");
datatable.DefaultCellBorderWidth = 1;
;
for (int i = 0; i < dt.Rows.Count; i++)
{
datatable.AddCell(new Cell(dt.Rows[i]["Test_Code"].ToString()), i+1,0);
datatable.AddCell(new Cell(dt.Rows[i]["Test_Name"].ToString()), i+1,1);
datatable.AddCell(new Cell(dt.Rows[i]["Test_Credits"].ToString()),i+1,2 );
}
document.Add(datatable);
}
catch (Exception e)
{
Console.Error.WriteLine(e.Message);
}
// we close the document
document.Close();
Response.Clear();
Response.AddHeader("content-disposition", "attachment;filename=Export.pdf");
Response.ContentType = "application/pdf";
Response.BinaryWrite(msReport.ToArray());
Response.End();
}
T.Balaji
|
|
|
|
|
|
Better, if you ask same third party for solution.
♫ 99 little bugs in the code,
99 bugs in the code
We fix a bug, compile it again
101 little bugs in the code ♫
|
|
|
|
|
I have an MVC web app and upon successful provider validation I use the following code:
FormsAuth.SetAuthCookie(userName, rememberMe ?? false);
return View()
I set a breakpoint after FormsAuth.SetAuthCookie and the Request has the cookie but HttpContext.User.Identity.IsAuthenticated is false.
When the page reloads there is no cookie and HttpContext.User.Identity.IsAuthenticated is still false.
It seems like I may be missing a step here. Any suggestions?
|
|
|
|
|
Have you tried FormsAuthentication.RedirectFromLoginPage(userName, RememberMe);
Alexei Rodriguez
|
|
|
|
|
So after I call FormsAuthentication.SetAuthCookie, should the following code return true immediately aftwards?
HttpContext.User.Identity.IsAuthenticated
If not then at what point should this code return true?
|
|
|
|
|
Im not sure
Once i had a login control and i was checking the User.Identity.Name inside the LoggedIn Event of the login control, but it wasnt returning the expected value
I then redirected the user to another page and there i would read the User.Identity.Name
Alexei Rodriguez
|
|
|
|
|
I'd like to know the rule on this so I can intelligently speak about it.
So is User.Identity.IsAuthenticated = true only after a redirect to a different page after authentication? For this to work does the redirect have to be with FormsAuthentication.RedirectFromLoginPage()?
|
|
|
|
|
When I am in a browser page I can hit the Print button on the browser toolbar and print the current page. The problem is that when I do this, sometimes not all of the page, usually the right hand side, does not get printed. Is there a way to capture the page, re-format it so that I can print the intire page and then print it. I have seen it done on my banking account, so I know that it can be done.
Thanks,
C# Spock
|
|
|
|
|
If it's a site you are coding, you can add a css file specifying which parts of the page to print and which to hide during print - eg
<link href="print.css" type="text/css" rel="stylesheet" media="print">
and within print.css you might, for example, set
#navigation { display:none; }
to hide your <div id="navigation"> bar...
...
If it's someone else's site, all you can really do is copy/paste the entire page into Word, say, and re-format it there before printing...
|
|
|
|
|
All
I have a web service that has been working fine until yesterday evening, I don't remember making any changes, but for some reason since yesterday evening I am getting the message "WSE910: An error happened during the processing of a response message, and you can find the error in the inner exception. You can also find the response message in the Response property." with inner exception as "Root Element Missing". I checked the xml file generated and can't find anything mistakes in it. I am using the same machine as client/server so there is no point of time difference.
Appreciate your help
Sri
|
|
|
|
|
Either the xml file is malformed or it's blank. Sounds like it's not blank, so if you could post it we might be able to spot the problem.
- S
50 cups of coffee and you know it's on!
A post a day, keeps the white coats away!
|
|
|
|
|
hello all how do i draw aline between 2 buttons in asp.net
i am adding to my application tow buttons dynamicaly
and trieng to drow aline between them by bitmap
when i draw the line the buttond disapear
so what to do
your help please
if you please aswer to
adnan.fast@gmail.com
|
|
|
|