Hi All I have a following requirement.At runtime I have to add multiple blocks of images into PlaceHolder/Panel>A block contains two images(LHSImage and RHSImage) with some HTML format as shown below.I know images can be added easily into a panel or Placeholder directly at runtime but donot know how to add with html format. $div id="parentDiv" style="width:100%;float:left;display:inline"$ $div id="LHSDiv" style="width:50%;margin-bottom:10px"$ $/div$ $div id="RHSDiv" style="width:50%"$
$/div$ $/div$ Note: 1. %Path% is calculated at runtime. 2. < angle brackets of divs are replaced by $ Adding HTML markup is mandatory. I donot want to achieve what I want by setting properties of images such as Top,Height etc.HTNL markup should be added. Any help will be appreciated. Thanks Regards Sandeep Kalra
THE SK
Posts
-
Add Images along with HTML markup at runtime into Panel/PlaceHolder -
How to convert string to valid virtual path?Hi All I am facing a challenge regarding URL. I am generating URL at runtime 'http://mysitename//Pages//Category.aspx?cat=eSOLPublicationCatalogOnNet&category=General exams' And I am getting an error 'http://mysitename//Pages//Category.aspx?cat=eSOLPublicationCatalogOnNet&category=General exams' is not a valid virtual path. Here General exams is having an error .It is showing it is not a valid virtual path. If i replace blank spaces with %20 in "General exams".Then it is working fine. Please guide. Thanks Regards Sandeep Kalra
-
deny tag of web.config not working on production serverHi All I have a website on which I am using following setting in web.config 1. to use forms authentication
<authentication mode="Forms">
<forms name="MyApplication" loginUrl="/_layouts/CommerceServer/CommerceloginPage.aspx" />
</authentication>2.To secure a folder named MyAcc from anonymous access
<location path="Pages/MyAcc" allowOverride="false">
<system.web>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</location>3.The membership provider
<membership defaultProvider="UpmProvider">
<providers>
<add applicationName="MyApplication"
enablePasswordRetrieval="false"
enableEmailAddress="true"
name="UpmProvider"
type="Microsoft.CommerceServer.Runtime.Profiles.UpmMembershipProvider,Microsoft.CommerceServer.Runtime,
Version=6.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" enablePasswordReset="true" requiresQuestionAndAnswer="false"
passwordFormat="Hashed"
PasswordStrengthRegularExpression="^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{6,50}$" /></providers> </membership>
Now the challenge is on my development server the deny tag works fine i.e when an anonymous user try to access pages which are there in MyAcc folder,the user gets redirected to login page. On the other hand on production site,the anonymous user is able to access the pages of MyAcc folder. Please suggest what could be wrong.Is there any other way to secure thge pages from anonymnous access. Thanks Regards Sandeep Kalra
modified on Monday, January 18, 2010 12:29 AM
-
asp.net 3.5 login controlHi There I am also facing challenges in asp:login controls. If you have implemented this please help. I am using Password recovery control of asp.net. Please tell me how to force user to change password after password recovery. And I want to force user to change password after every 60 days.How can i force user to change password after every 60 days. I do not want to write custom code.Can I achieve this with the login controls(PasswordRecovery,ChangePassword,Login etc) provided in asp.net Googling did not helped me. Thanks Regards Sandeep
-
Force password change after Password recoveryHi All I am using Password recovery control of asp.net. Please tell me how to force user to change password after password recovery. And I want to force user to change password after every 60 days.How can i force user to change password after every 60 days. I do not want to write custom code.Can I achieve this with the login controls(PasswordRecovery,ChangePassword,Login etc) provided in asp.net Googling did not helped me. Please help Thanks Regards Sandeep
-
asp:menu issueThanks Abhishek Now got the right answer . But please tell me what the following css code do #nav a:hover >ul { //css to display } Thanks Regards Sandeep
-
asp:menu issueAbhijit thanks for your answer Does the menu on the codeproject site is implemented in the same way? After disabling the javascript would cssadapters will work? The codeproject menu works even after disabling javascript on the browser. Thanks Regards Sandeep
-
asp:menu issueHi All I want to add a menu somewhat like that of codeproject(see above the green horizontal div) Home Articles Quick Answers etc I was using asp:menu <asp:menu id="NavigationMenu" staticdisplaylevels="2" staticsubmenuindent="10" orientation="Vertical" target="_blank" runat="server" > <DynamicMenuItemStyle BackColor="Aqua" Font-Bold="true" /> <dynamichoverstyle backcolor="Green" forecolor="Black"/> <items> <asp:menuitem navigateurl="Home.aspx" text="Home" tooltip="Home"> <asp:menuitem navigateurl="Music.aspx" text="Music" tooltip="Music"> <asp:menuitem navigateurl="Classical.aspx" text="Classical" tooltip="Classical"/> <asp:menuitem navigateurl="Rock.aspx" text="Rock" tooltip="Rock"/> <asp:menuitem navigateurl="Jazz.aspx" text="Jazz" tooltip="Jazz"/> </asp:menuitem> <asp:menuitem navigateurl="Movies.aspx" text="Movies" tooltip="Movies"> <asp:menuitem navigateurl="Action.aspx" text="Action" tooltip="Action"/> <asp:menuitem navigateurl="Drama.aspx" text="Drama" tooltip="Drama"/> <asp:menuitem navigateurl="Musical.aspx" text="Musical" tooltip="Musical"/> </asp:menuitem> </asp:menuitem> </items> </asp:menu> But I have seen that if I disable javascript on my browser asp:menu doesnot work. However codeproject menu works even after disabling the javascript. Please guide which control is the codeproject using for menu.I want to use the same Thanks Regards Sandeep
-
How to Format Text in ASP.net ?????????Hi All I have a requirement similar to that seen on codeproject website. I have a requirement which will allow the user to add HTML text in a control(most appropriate Textbox control in multiline mode) and then save it in a file or database.The text will be displayed later when the user visits the page. And I want to allow only some HTML tags not all. For eg Codeproject allows the tag for code and pre
And if I write a script alert("Hello world"); tag is ignored in codeproject. 1.How can I achieve this???? And also when we submit the article on codeproject we add the text in textbox control but when our article is published we see our article on a page not in a control(label). 2.How is this achieved?????????? Please provide guidance for the above two requirements Thanks The SK</x-turndown>
-
How to handle request validation exceptionHi All I have the following code <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <script language="C#" runat="server"> protected void button1_Click(object sender, EventArgs e) { try { TextBox1.Text = (TextBox1.Text + "<strong></strong>"); Label1.Text = (TextBox1.Text); } catch (System.Web.HttpRequestValidationException) { Response.Write("html is not allowed"); } } </script> <!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> </head> <body> <form id="form1" runat="server"> <div> <asp:TextBox ID="TextBox1" runat="server" TextMode="MultiLine" Height="300px" Width="400px"></asp:TextBox> </div> <asp:Button ID="button1" runat="server" Text="strong" onclick="button1_Click" /> <asp:Label ID="Label1" runat="server"></asp:Label> </form> </body> </html> If i click on button twice I am getting request validation exception which I want to catch. The error which I am getting is ************************************************************************* Server Error in '/TextControlOnSite' Application. -------------------------------------------------------------------------------- A potentially dangerous Request.Form value was detected from the client (TextBox1="<strong></strong>"). Description: Request Validation has detected a potentially dangerous client input value, and processing of the request has been aborted. This value may indicate an attempt to compromise the security of your application, such as a cross-site scripting attack. You can disable request validation by setting validateRequest=false in the Page directive or in the configuration section. However, it is strongly recommended that your application explicitly check all inputs in this case. Exception Details: System.Web.HttpRequestValidationException: A potentially dangerous Request.Form value was detected from the client (TextBox1="<strong></strong>"). Source Error: [No relevant source lines] Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\textcontrolonsite\d5a3eadf\30926e30\App_Web_rwvmmuiv.0.cs Line: 0 Stack Trace: [HttpRequestValidationException (0x80004005): A poten
-
[Message Deleted][Message Deleted]
-
simple PAssword PolicyI need RegEx for this. Actually there is a web part (which is implemented using usercontrol) whose compiled dll is in GAC The designer code is in file. In web part username and paasword textbox is there There is also a login button on which the event which is in compiled assembliy in GAC get fired I cannot write code.I know its easy using code I am putting a regular expression validator in the designers code.So only through Regex things can be done Please help Thanks Regards THE SK
-
simple PAssword PolicyHi All I am struggling to make a regular expresssion for the password policy. There are only two requiremnts for the password policy 1. Password should of length atleast 6 2. password must contain atleast two characters at any position. Match cases(for which regex should pass) are 1. rt5465465 2. 6556h76f 3. 76d12j 4. s45)$f Cases for which regex should fail are 1. w565765 2. 872310 3. 4r@%&9 4. gghj The regex whixh I have made so far are in the below code using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Text.RegularExpressions; namespace WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { //Regex regex = new Regex("(.*[a-zA-Z].*[a-zA-Z])"); // Regex regex = new Regex("(?(^(?=.+[a-zA-Z$#%^&*()!@~+]){6,}))(?(.*[a-zA-Z].*[a-zA-Z]))(.{6,})"); Regex regex = new Regex("(^[.]*${6,})"); //Regex regex = new Regex("([a-zA-Z0-9]{6,})"); //Regex regex = new Regex("(?(?=[.]{6,})(.*[a-zA-Z].*[a-zA-Z])([Z][9][4][M][P]))"); // Regex regex = new Regex("(?(^(?=.+[a-zA-Z$#%^&*()!@~+]){6,}))(.*[a-zA-Z].*[a-zA-Z])"); // Regex regex = new Regex("(?(?=[0-9]{5,5}[a-z])([6])([1]{5,5}))"); // Regex regex = new Regex("(?(?=[0-9]{5,5}[a-z])()([1]{5,5}))"); //Regex regex = new Regex("(?(?=[a-zA-Z0-9]{6,})()(([1])([1])([p])))"); string s = textBox1.Text; if (regex.IsMatch(s)) { MessageBox.Show("pass"); } else { MessageBox.Show("fail"); } } } } Please help Thanks Regards Sandeep