|
Hi,
try this code below, if your page name is "signin.aspx" than
StringWriter sw = new StringWriter();
HttpContext.Current.Server.Execute("~/signin.aspx",sw,true);
String renderedHtml=sw.ToString();
|
|
|
|
|
Perhaps if you explained what is you are trying to accomplish we could assist you better.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi,
I am sorry for asking such an obvious question, and (frustratingly) I KNOW what I am looking for is on this website somewhere already, but could anyone be good enough to point me at a good article for writing a base page class for an ASP.NET base page?
Best wishes, Patrick
|
|
|
|
|
Have a look these links. Might be useful.
Link 1[^]
Link 2[^]
Regards,
TweakBird
***** Posted 50000th post in GIT O_O ******
|
|
|
|
|
Patrick Skelton wrote: I am looking for is on this website
I guess you missed this "on this website"
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Mark Nischalke wrote: you missed this "on this website"
Yes. I missed it.
Regards,
TweakBird
***** Posted 50000th post in GIT O_O ******
|
|
|
|
|
|
Thanks for those links. Very useful. I think the one on 4GuysFromRolla was the one I read originally. I think I was mistaken about it being on CodeProject.
Thanks again.
Best wishes, Patrick
|
|
|
|
|
Patrick Skelton wrote: I think the one on 4GuysFromRolla was the one I read originally.
Next time, Bookmark it!
You can flame me whichever way you want and I wouldn't care a bit.
But if you group me with some idiots, I'll turn into your worst nightmare.
|
|
|
|
|
I thought I had. I am, however, human.
|
|
|
|
|
I use the following code in order to conncet my asp.net website to facebook
string appId = "xxx";
string[] extendedPermissions = new[] { "publish_stream", "offline_access" };
var oauth = new FacebookOAuthClient { AppId = appId };
var parameters = new Dictionary<string, object>
{
{ "response_type", "token" },
{ "display", "popup" }
};
if (extendedPermissions != null && extendedPermissions.Length > 0)
{
var scope = new StringBuilder();
scope.Append(string.Join(",", extendedPermissions));
parameters["scope"] = scope.ToString();
}
var loginUrl = oauth.GetLoginUrl(parameters);
Response.Redirect(loginUrl.AbsoluteUri);
but when I run this I get a login page(full page altough I set the display property to "popup"), and after login I redirected to a page which is not my website page(http://www.facebook.com/connect/login_success.html#access_token=xxx;expires_in=0). The page includes the word "succeed" only...
|
|
|
|
|
benams wrote: The page includes the word "succeed" only...
Then what can we do?
It's very hard to get response from CP about question related to FB. So you canask these question in FB forum then you can get more response.
http://forum.developers.facebook.net/[^]
Thanks
Parwej Ahamad
ahamad.parwej@gmail.com
|
|
|
|
|
I read it supposed to take me back to the previous page so I could get information from the logged FB account.
|
|
|
|
|
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
|
|
|
|