|
No, don't try to insert the elements in the html code, split up the string and add the html code as plain text and the controls in between.
Simple example:
DaPlaceHolder.Controls.Add(new LiteralContrl("<div>"));<br />
DaPlaceHolder.Controls.Add(someControl);<br />
DaPlaceHolder.Controls.Add(new LiteralContrl("</div><div>"));<br />
DaPlaceHolder.Controls.Add(otherControl);<br />
DaPlaceHolder.Controls.Add(new LiteralContrl("</div>"));
---
b { font-weight: normal; }
|
|
|
|
|
I'm "trying to try it" here but can't get this to compile:
string[] tags = RegEx.Split(htmlCode, "@@(.+?)@@");
ERROR=The name 'RegEx' does not exist in the current context
my includes:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;
using System.Text.RegularExpressions;
I have no experience at all with regular expressions..
would you mind making a sample file for me please?
|
|
|
|
|
whoops, just learned something, its Regex, not RegEx...
|
|
|
|
|
alright, I finnally got that part working, I really appreciate your help.
Since I don't know nothing about regex I would like to make complementar question:
If I design the html using an editor I will have the whole html structure when I read the file,
I was thinking of how can I parse the , and tags from the html so I could strip their contents and print them out on the correct place on my aspx, it would be so much easier than cutting down the design html parts everytime I change it and to hardcode additional css or js on the header, for example the following design:
------------------------------------------------
<script....!
<link...!
<head="">
<script>....!
<form>
<table...!
...!
<table...!
<form>
<div...!
<body>
------------------------------------------------
if I could just parse those main elements and get the contents inside them (ending with "!") printing those lines my aspx file... do you think it is possible?
an idea (ASPX):
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>template 2</title>
<% loadCustomHtmlHeaderContents() %>
</head>
<body>
<% loadCustomHtmlBodyUpperContents() %>
<form id="form1" runat="server">
<asp:PlaceHolder ID="TemplatePlaceHolder" runat="server"></asp:PlaceHolder>
</form>
<% loadCustomHtmlBodyLowerContents() %>
</body>
the html file <form> tag would just be ignored since I already have one on my aspx file, I would need it just to reference whats between the <body> and <form> and between </form> and </body>.
===Updated===
or even better , if I add a placeholder to each one of those sections (header,upperbody,lowerbody) it would be much easier to add content there, I just would need a regex to know when I am inside a placeholder like this:
@@header@@
@@/header@@
or
@@upperbody@@
@@/upperbody@@
can you help me parsing that?
at last, I intend to use this on a masterpage and I have just one contentplaceholder there, I was able to clone that control adding it to the placeholder and it shows fine the contents from the other pages but the viewstate is lost... I tried to move the contentplace holder but I think that's not possible, the parent property is locked, is that possible? to put the contentplacholder on the place that I want(move)?
I tried:
//
TemplatePlaceHolder.Controls.Add(MasterPageContentPlaceHolder);
//
the contentplaceholder renders fine but if I use a grid for example and select a row I get:
"System.NullReferenceException: Object reference not set to an instance of an object."
when accessing "GridView1.SelectedValue.ToString()"
it looks like the viewstate is gone after the postback, is that it?
thank you so much again
-- modified at 21:25 Sunday 8th October, 2006
|
|
|
|
|
I have a web site inside my organization that shows the performance of the work load, the site has different security levels according to the user that loggs the site (the security is left to b handled by "windows"),so i want to know the active directory loginame for the user that uses the site in order to load security of the site.
I tried to get the IP of the user request using Request.ServerVariables and using this IP i get the name of the user, but in the server i get invaild names compared to active directory names.
So i need any method that helps me to get the active directory loginame in order to load its security.
Thanks.
marp tech
|
|
|
|
|
Hmmm... I thought I answered this the last time you posted it.
|
|
|
|
|
You don't understand what i want, i don't want to check the user against active directory because i will not provide a login form, i just want to know the login name in the active directory for the user that requsted the page without any inforamtion from the user, i mean that the user will not enter any login name or password, i just want to know if the requrst has came from the network to load the secutity level.
marp tech
|
|
|
|
|
Marp Tech wrote: You don't understand what i want
Well of course I didn't understand what you wanted! I was going by what you wrote, not what you were thinking. The latter is beyond my abilities; I can only go by the former.
Marp Tech wrote: i just want to know the login name in the active directory for the user that requsted the page without any inforamtion from the user
You want to know the login name for the current user, but you don't want that user to log in? Okay. Good luck with that.
Marp Tech wrote: i just want to know if the requrst has came from the network
I don't think there is a reliable way to accomplish this without user tracking. You could grab the IP address of the computer making the request and determine if it is on your network or not - that you could do easily enough. But there are ways to spoof an IP address so I wouldn't call it reliable.
|
|
|
|
|
So how come Windows 2003/SQL Server does not support Active-Active clusters? And is there a maximum number of nodes... even with Active Passive? Is this the reason why SQL Server is "inferior" to Oracle?
Educate me.
|
|
|
|
|
Hello
i had add the edit column to the datagrid and the type of the column is link lable
I WANTto call the update LINK when i press Enter on the TextBox
Mohamad A. Flefel
C#.net Developer
|
|
|
|
|
Hello,
I am trying to convert an Asp.Net 2.0 XML sitemap file to a Google's sitemap file.
I am posting the formats of both files.
1. How can I do the conversion?
2. And can I use an .ashx Asp.Net file that when the .ashx file is called the Google XML file is generated?
Thank You,
Miguel
GOOGLE SiteMap
<?xml version="1.0" encoding="UTF-8"?>
< urlset xmlns="http://www.google.com/schemas/sitemap/0.84">
< url>
< loc>http://www.mydomain.com/example.aspx</loc>
< lastmod>2005-01-01</lastmod>
< changefreq>daily</changefreq>
< priority>0.8</priority>
</url>
</urlset>
ASP.NET 2.0 Site Map
<?xml version="1.0" encoding="utf-8" ?>
<siteMap
xmlns = "http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode>
<siteMapNode
url = "~/example.aspx"
changefreq = "daily"
lastmod = "2005-01-01"
description = "My example page and its contents"
priority = "0.8"
title = "Example page" />
</siteMapNode>
</siteMap>
Note: description and title should be droped when converting from Asp.Net to Google sitemap.
|
|
|
|
|
|
how can i enable debugging in web service?
my client cannot access the service if i create it in the wwwroot\folder\service... however it can access it wwwroot\service like this can i get a logical reason for this
Bu
|
|
|
|
|
i think your problem is that your debugging account has no access rights to subfolders. in the iis snap-in make sure that anonymous access is granted and the account is IUSR_[machinename].after that check event-log if ASPNET user has any problems.
|
|
|
|
|
from where i can set all this??
|
|
|
|
|
what is the Diff between sqlConnection and oleDbconnection?
Which is better and why?
Mini
|
|
|
|
|
If you are going to a sql database, use SQL. Otherwise for Access and Oracle, use OLEDB. The SQL one does not have to go through OLEDB and can talk directly to SQL so it's faster (one less middle man).
|
|
|
|
|
|
i have a templete column with chechbox in datagrid. i want when i checked the checkbox with push the button i can delete that row. how u can help me?
|
|
|
|
|
|
Hello ,
I need an example about Multiple Delete in DataGrid using Checkbox however i need it in C# using ASP.Net
Thanks,
Mini
|
|
|
|
|
Hello friends,
I'm entering the ASP.Net technology World and I have some beginer questions, so please, don't be too hard
Ok, I need to do a "left side" menu. I have a table with main categories and other table with subcategories related to its main categories.
In the old ASP I just iterate with two "for", one for the main categories containing the other for the sub-categories belonging to the current category.
Quite easy, just put the ASP code in the right part of my page and I have my menu.
But in ASP.Net and the code-behing pages I don't know how to o this, because I can't put the ASP.Net code embebed into the HTML code.
I know this should be a very thumb questoin but....everybody has a begining
Thanks a lot
|
|
|
|
|
|
I am trying to debug an asp.net vb.net project on an XP machine.
When I start to debug I get this error:
Error while trying to run project: Unable to start debugging on the server. You do not have permissions to debug the server.
Verify that you are a member of the 'Debugger Users" group on the server.
I am certain that I am a member of the Debugger Users group. I am also a member of the Administrators group (as Help suggests).
I tried everything in the help file and nothing worked. Does anyone have any suggestions ?
|
|
|
|
|
Have u installed VS 2005 recently?
Or do u have it installed on ur machine with the VS.net 2003?
Best Regards
3ala2
|
|
|
|