C# - Include URL Inside URL?
Sep 10, 2010
I want to use the following format of my url:
http://localhost/{url}/{options}/{hash} But since the url will be very strange with a url inside a url, how would I encode that?
I was thinking of encoding it in hex, since url encoding in .net gave me some strange result that didn't work inside a url. But I don't really know what would be the best way here.
I want to keep the structure of the url, not including any querystring.
View 2 Replies
Similar Messages:
Jul 14, 2010
Possible Duplicate: Include javascript file inside javascript file?
Including a reference to another .js that your current .js file code is reliant on instead of having to add 2 includes in every page to ensure that both those files are there? I assume the answer is no...as I have not found any info on it on the net so far.
View 4 Replies
Jul 13, 2010
http://i966.photobucket.com/albums/ae149/lovedota/yahoo.jpg
View 2 Replies
May 14, 2010
I have a requirement to add a new asp.net functionality to an existing static html web site.Its about adding few text boxes and connecting to database and displaying information on the html web site.Is it possible to merge html and asp.net on a html web site?
View 3 Replies
Feb 16, 2010
Can we include vertical menus inside of horizontal menu?? I want to dynamically add vertical menus( the values of the items inside of that are driven from the database) to a horizontal menu to get a tab strip like look and feel.Further is there an other way to making this process dynamic so that adding some values to the database drives the menus that appear on my page?
View 1 Replies
May 20, 2013
I have just started with ASP.NET.
I like the idea of using Include files so that I can create various versions of individual parts of a site and decide in code which to display. I used:
<%Response.WriteFile("contentcontent.aspx")%>
to include a content.aspx file within my default.aspx page.
I would like to include a Left.aspx, Main.aspx and Right.aspx file inside the content.aspx file. I tried using the reponse.writefile function but noticed when I debug the website that the text "reponse.writefile..." displays instead of the code contained within the referenced file(s).
Can this not be done?
View 6 Replies
Apr 16, 2010
All I would like to be able to do is include one user control within another! Is this possible? I have spent the last hour searching the internet and it seems that I can't find a single thing.
In classic ASP it would be something like:
<!--#include file="EditProject.ascx"-->
I tried this but no luck!
Parser Error Message:
There can be only one 'control' directive.
Source Error:
[Code]....
Line 1: <%@ Control Language="VB" AutoEventWireup="false" CodeFile="EditProject.ascx.vb"Line 2: Inherits="Controls_WebUserControl" %>Line 3: <form runat="server">
View 3 Replies
Sep 23, 2010
my requirement is showing the clock in asp.net {this should show all hh:mm:ss}....
View 4 Replies
Jul 22, 2010
Since virturl directory name is not fixed, I wrote code below to include .css file in .aspx page now.
<link rel="Stylesheet" href="<%= ResolveUrl("~/Css/xxx.css") %>" type="text/css" />
The question is, when I use "ResolveUrl" in tag, IDE is always barking about that all CSS classes is undefined.
Is there any better way to define .css file including?
View 3 Replies
Mar 2, 2010
I use the code bellow to dynamically include a CSS file:
HtmlHead head = (HtmlHead)Page.Header;
HtmlLink link = new HtmlLink();
link.Attributes.Add("href", Page.ResolveClientUrl("~/App_Themes/Default/StyleSheet.css"));
link.Attributes.Add("type", "text/css");
link.Attributes.Add("rel", "stylesheet");
head.Controls.Add(link);
The problem is: I want to do it only once, and only if it isn't alrealy included in the page.
How do I verify if it is already included?
Edit:
Answers telling me to include in page load using !IsPostBack won't solve my problem, as this code will be inside a Web User Control and my page may have a lot of the same user control.
For example, I use the code below to do it with javascript:
if (!Page.ClientScript.IsClientScriptIncludeRegistered("jsScript"))
{
Page.ClientScript.RegisterClientScriptInclude("jsScript", ResolveUrl("~/Utilities/myScript.js"));
}
View 3 Replies
Jun 14, 2010
Is the classic way of using include files still the best practice in ASP.NET. IS there a better way in ASP.NET to simulate include files? IF not can someone please provide an example of the .NET way?
View 5 Replies
Apr 16, 2010
if there's someone could help me to solve the problem,i'll be delighted ...
View 6 Replies
Feb 11, 2010
how to include .swf file in html 4 without <embed> tag
View 2 Replies
Jul 6, 2010
Can anyone tell how to include, save and use the google maps in asp.net applications??
View 5 Replies
Mar 2, 2010
I've read that Microsoft now bundles jQuery with Visual Studio. How then do I "include" the jQuery source in my ASP.Net project?
View 3 Replies
Aug 20, 2010
I'm using DotNetNuke 4.8.x and want to utilize jQuery. Could anyone possibly suggest me on what is the best way to integrate jQuery into DNN? I won't be able to upgrade DNN version to 5 which has built-in support for jQuery.
View 1 Replies
Oct 25, 2010
How do I include CSS reference in only certain pages on my asp.net website? If I include the reference in my master page, all pages of the website share the CSS reference.
View 2 Replies
Apr 4, 2011
I am testing an aspx page I wish to use to post to but I cannot seem to send the certificate over with the data. Here is my client code:
System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
string postData = "age=23&state=47";
byte[] data = encoding.GetBytes(postData);
X509Certificate x509certificate = X509Certificate.CreateFromCertFile(@"C:Documents and Settings
cimbaloMy DocumentsDownloadsSSL Certificates estCert.cer");
string key = x509certificate.GetPublicKeyString();
string certData = Encoding.ASCII.GetString(x509certificate.Export(X509ContentType.Cert));
string pks12 = Encoding.ASCII.GetString(x509certificate.Export(X509ContentType.Pkcs12));
HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create("http://localhost:3493/Index.aspx");
myRequest.Credentials = new NetworkCredential("xxxx", "yyyy");
myRequest.Method = "POST";
myRequest.ContentType = "application/x-www-form-urlencoded";
myRequest.ContentLength = data.Length;
myRequest.ClientCertificates.Add(x509certificate);
Stream newStream = myRequest.GetRequestStream();
newStream.Write(data, 0, data.Length);
newStream.Close();
System.IO.StreamReader st = new StreamReader(((HttpWebResponse)myRequest.GetResponse()).GetResponseStream());
Console.Write(st.ReadLine());
and here is the code from my aspx page:
protected void Page_Load(object sender, EventArgs e)
{
if (this.CheckCredentials())
{
string data = this.Context.Request.Form.ToString();
}
}
private bool CheckCredentials()
{
string userName = User.Identity.Name;
HttpClientCertificate certificate = Request.ClientCertificate;
if (certificate.IsPresent)
{
string w = certificate.Get("SUBJECT 0");
return true;
}
return false;
}
There is never a certificate present.
I found this earlier post X509Certificate not getting transmitted to the server
But did not understand the answer. I created a certificate using the MakeCert.exe utility but I do not really understand why it does not work.
View 1 Replies
Mar 1, 2010
i have function
public Menu Details(int? id)
{
return _dataContext.Menu.Include("ChildMenu").FirstOrDefault(m => m.MenuId == id);
}
now i need to add condition to child list ChildMenu something like fieldname=id. how can i do it?
View 6 Replies
Mar 15, 2010
my aspx file is include in master page.
now i can't call js function which i already include in the file when page is loaded.
page_load (cs file)
Page.ClientScript.RegisterClientScriptInclude(this.GetType(), "1", "test.js");
Page.ClientScript.RegisterStartupScript(this.GetType(), "2", "<script type="text/javascript">testing();</script>");
test.js
function testing(){
alert("test");
}
but an error msg occurs: object expect?
View 3 Replies
Jan 2, 2011
i want to execute more than one query in a page.i tried to use sqlreader it didnt allow me to include.how to do ?This is my code.
[Code]....
this is how i did.it shows me error.how to solve this error?
View 3 Replies
Aug 12, 2010
I need to include a ticker in my asp.net web form.
the ticker will take the data from an xml file.
View 1 Replies
Jun 10, 2010
I'm trying to see what is the best way to include some protection against XSS in a web app but it needs to be easy for the developer!
Let me explain. I'm going to provide a library for the developers which will include the security controls. I'm thinking I have two choices:
1) Include some HTML encoding functions in that library e.g. AntiXSS and let the developer call the function every time he needs to output something
e.g.
Response.Write(AntiXss.HtmlEncode(value));
2) Create a new write method
Response.Writesecure(value)
The writesecure method would then call the appropriate functions and it would be transparent to the developer.
Additionally, I can write some easy code analyis scripts that will identify the use of the standard Write method...
View 3 Replies
Nov 25, 2010
I would like to have two .css files. One for each mastercontent page and one file for common elements. How to do this?
The following code doesn't work (css classes from Common.css file are not avalaible)
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
<link href="MasterPage.css" rel="stylesheet" type="text/css" />
<link href="Common.css" rel="stylesheet" type="text/css" />
<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<div id="Master_Header" CssClass="SomeClassFromCommonCssFile"></div>
</form>
</body>
</html
View 1 Replies
Mar 25, 2011
I got custom attributes to work on the server and client, now I want to DRY things up just a little more. How do you override the pattern for RegularExpressionAttribute to include the DisplayName?
Right now I am like this:
[Code]....
Which results in:
[Code]....
View 1 Replies