|
Parwej Ahamad wrote: It's very hard to get response from CP about question related to FB
Even more difficult when the OP doesn't follow the forum guidelines and format any code posted.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Yes Mark, you are absolutely right.
Parwej Ahamad
ahamad.parwej@gmail.com
|
|
|
|
|
Follow the forum guidelines and format your code, and you may receive more responses. If you can't follow the guidelines why should we read your question or help?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi,
I have an element name Sections under wich I have another element as Section as in the below code. When I deserialize this xml I am getting objects as section[0] etc. Can I make it to deserialize in the way that I can get it in the form of Key, Value pairs.
Any kind of help is greatly appreciated. Its urgent please help me. Its able to deserialize but I want it in the form of key, value pairs. Is it possible in the below scenario, any kind of help please appreciated.
XML File
<?xml version="1.0" encoding="utf-16"?> <DiffEngineConfig>
<Sections>
<Section Name="PersonalProfile=" Include="true=" />
<Section Name="PersonalProfileAddresses=" Include="false=" />
<Section Name="PersonalProfileAlerts=" Include="true=" />
<Section Name="PersonalProfileEmployments=" Include="false=" />
<Section Name="PersonalProfileNames=" Include="true=" />
<Section Name="PersonalProfileStatements=" Include="false=" />
<Section Name="ScoreDelta=" Include="true=" />
<Section Name="ScoreDeltaFactors=" Include="false=" />
<Section Name="NewPublicRecords=" Include="true=" />
<Section Name="ClosedCollections=" Include="false=" />
<Section Name="DerogatoryCollections=" Include="false=" />
<Section Name="RemovedCollections=" Include="true=" />
<Section Name="ClosedTradelines=" Include="false=" />
<Section Name="CreditLimitChanges=" Include="true=" />
<Section Name="DerogatoryTradelines=" Include="false=" />
<Section Name="NewAccounts=" Include="false=" />
<Section Name="RemovedTradelines=" Include="true=" />
<Section Name="NewInquiries=" Include="false=" />
</Sections>
<ValidationType Missing="false=" Extra="true=" />
</DiffEngineConfig>
Serializing classes
[Serializable]
[XmlRoot("DiffEngineConfig")]
public class DifferenceEngineConfig
{
[XmlElement("Sections")]
public Sections Sections
{ get; set; }
[XmlElement("ValidationType")]
public ValidationType ValidationType
{ get; set; }
}
[Serializable]
public class Sections
{
[XmlElement("Section")]
public List<Section> Section
{ get; set; }
}
[Serializable]
public class Section
{
[XmlAttribute("Name")]
public string Name
{ get; set; }
[XmlAttribute("Include")]
public bool Include
{ get; set; }
}
[Serializable]
public class ValidationType
{
[XmlAttribute("Missing")]
public bool Missing
{ get; set; }
[XmlAttribute("Extra")]
public bool Extra
{ get; set; }
}
Code to Serialize
private static DifferenceEngineConfig GetDifferenceEngineConfig(string strxml)
{
StringReader stringReader = new StringReader(strxml);
XmlTextReader xmlReader = new XmlTextReader(stringReader);
XmlSerializer _serializer = new XmlSerializer(typeof(DifferenceEngineConfig));
DifferenceEngineConfig differenceEngineConfig = (DifferenceEngineConfig)_serializer.Deserialize(xmlReader);
return differenceEngineConfig;
}
private static string ReadXmlFromFile(string fileFullPath)
{
string xml = string.Empty;
using (StreamReader reader = new StreamReader(fileFullPath))
{
xml = reader.ReadToEnd();
reader.Close();
}
return xml;
}
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
I am not very proficient with XML. However, my guess would be that you need to parse the data that you deserialize and place it into key/value pairs in that manner.
djj55: Nice but may have a permission problem
Pete O'Hanlon: He has my permission to run it.
|
|
|
|
|
Hi,
I have a datatable from which i am exporting the results to Excel file.The exporting happens perfectly....But web page is not getting loaded completely.Its because of the Response.End();.It terminates the execution of the page further.
Because I have some other code after Response.End(); to get executed and needs to be displayed in the page.Is there a way to get the complete execution of the page.I am struck with this problem for while now..........Any help is appreciated.
DataTable dtMemberList = LinqToDatatable.LinqToDataTable(MembersList);
string attachment = "attachment; filename=Search.xls";
Response.ClearContent();
Response.AddHeader("content-disposition", attachment);
Response.ContentType = "application/vnd.ms-excel";
Response.Write("\n");
Response.Write("Search Results");
Response.Write("\n");
string tab = "";
Response.Write(tab + "Member ID");
tab = "\t";
Response.Write(tab + "Memberdoc Received Date");
tab = "\t";
Response.Write(tab + "Memberdoc Import Date");
tab = "\t";
Response.Write(tab + "Memberdoc Status");
tab = "\t";
Response.Write(tab + "Memberdoc Type");
Response.Write("\n");
int i;
foreach (DataRow dr in dtMemberList.Rows)
{
tab = "";
for (i = 0; i < dtMemberList.Columns.Count; i++)
{
Response.Write(tab + dr[i].ToString());
tab = "\t";
}
Response.Write("\n");
}
Response.End();
|
|
|
|
|
Format your code snippet as described in the forum guidelines and you might actually get someone to respond.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi,
When a user is trying to do use a search functionality on my web application, he is getting a timeout.
But when he is accessing the same web application from another pc, with the same login details, specifying the same search criteria, the results are being displayed successfully.
Any idea why on another pc, he is getting a time out? Is it related to cookies or browser history?
Cheers
|
|
|
|
|
It could be anything, but you can bet it's got to do with the browser or the OS (most likely the browser). Install a different browser on the box, and see if that one works any better. If it does, the browser configuration is somehow borked up.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|
|
Hi,
I have scenario in which I want to execute OnClientClick after OnClick. The default behavior is vice-versa. How can I achieve same.
Please help. Thanks.
// ♫ 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'm trying to capture the username (and domain) of the user accessing the web application (web server on the same domain for starters). I have modifed the IIS settings to use Windows authentication and added stuff to web.config and use the following code below to capture this information - and it works as long as the web server is the localhost i.e it works only if the web app is accessed via a browser on the web server. Otherwise it returns a null string, what do I need to do? (currently buidling on .NET 2.0)
Snippet of code in VB.NET (objGenericIdentity.Name contains null string when web app is accessed outside of web server):
Dim formsAuthTicket As FormsAuthenticationTicket
Dim httpCook As HttpCookie
Dim objGenericIdentity As GenericIdentity
Dim objMyAppPrincipal As securityPrincipal
Dim strRoles As String()
httpCook = Context.Request.Cookies.Get("authCookie")
formsAuthTicket = FormsAuthentication.Decrypt(httpCook.Value)
objGenericIdentity = New GenericIdentity(formsAuthTicket.Name)
strRoles = formsAuthTicket.UserData.Split("|")
objMyAppPrincipal = New securityPrincipal(objGenericIdentity, strRoles)
HttpContext.Current.User = objMyAppPrincipal
web.config contains this:
authentication mode="Windows"
identity impersonate="true"
(I'm not using anything related to formsauthentication in the web.config file, do I need to?).
And finally, what would I need to do to get this info when web app is accessed from a different domain?
arvind
|
|
|
|
|
|
Hi, i want to change my url by url rewritting. In the root of my application a Group name folder exists. in that folder user page exists..
after login url looks like that..
www.abc.com/Group/MyProfile.aspx
but i want to change like that
www.abc.com/Myusername/MyProfile.aspx
means i want to change Group folder name with my UserName.
can we don this with url rewritting or anything else we have to do .
Thanks.
|
|
|
|
|
This may help[^]
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC Link[ ^]
Trolls[ ^]
|
|
|
|
|
|
For an ASP C# website I made, I have user authentication using the Membership framework with SQL Server as the back end. The only complaint so far is that after a certain amount of time, they get automatically logged out. Is there anything I can do to make sure that users will stay permanently logged in unless they manually logout?
Edit: The webserver is IIS 7.5. I suppose this could just as easily be an IIS question.
|
|
|
|
|
The default timeout for session is 20 minutes. If the user takes no action, i.e. refreshing the page or navigating to another one, the server can't tell if they closed their browser, gone somewhere else, or died. You can adjust the timeout via the web.config file but you will still be left with the same problem, just at a later time
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Mark Nischalke wrote: You can adjust the timeout via the web.config file but you will still be left with the same problem, just at a later time
I figure setting it to 122 years and 164 days should be sufficient.
Driven to the ARMs by x86.
|
|
|
|
|
Add 12 hours just to sure
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi,
I've a web application in ASP. I want when a user clicks on button, the data on a particular webpage is saved in a PDF file and the user can append the data in the pdf file.
Any idea?
Thanks
|
|
|
|
|
Legacy ASP, or ASP.Net? You have to find a 3rd-party library to do what you want.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|
|
I actually did just that at one point. I found that the free libraries were crap (didn't render the page as expected). The way I got around it was to use a Windows Forms WebBrowser to render the page (on the server side), render that control to a bitmap (WebBrowser.DrawToBitmap), save that bitmap as a PNG, embed that PNG into a PDF (the free libraries seem to be capable of at least this), then return that PNG to the browser as raw byte data (this will help you figure that out). I also remember having to do some custom HTML parsing to print each page neatly. It's tricky, but can be done (took me 2-4 days IIRC). Google for anything above you don't know how to do (e.g., you can google for free PDF libraries).
Driven to the ARMs by x86.
|
|
|
|
|
I want to convert xml file to pdf using C#.Can u please help me to do this
|
|
|
|
|