.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Login LayoutTemplate doesn't format correctly

Posted By:      Posted Date: October 03, 2010    Points: 0   Category :ASP.Net

The layout of my login control and LayoutTemplate must use widths in percentages:

        <div style="width:60%; float:left">
            <asp:Login ID="Login1"   
            <div style="width:100%">

But the LayoutTemplate wraps its Html in a table container so the source code looks like:

        <div style="width:60%; float:left">
            <table id="Login1" cellspacing="0" cellpadding="0" border="0" style="border-collapse:collapse;">
            <div style="width:100%">

The table has no width set so the cascade between the divs is broken and consequently the LayoutTemplate's Html does not format correctly.

If I manually set the table width to 100% it works fine.

How can I programmatically address the table to set its width to 100%?

I can use CSS with:

table#Login1 {width:100%;}

but this is very messy in my CMS application not least that ASP.NET changes the ID of the table to ct100_Main_Login1.

Your help would be much appreciated (any code snippets preferably i

View Complete Post

More Related Resource Links

Office document are not opened correctly! (XLSX gives error. XLS asks login)

I have SharePoint 2010 based farm and MS Office 2007. SharePoint have Enterprise feature enabled. In my test I'm opening documents in the front-end machine. Problem 1: When XLSX excel documents are tried to be opened, it try to open to the browser. Error is given: Your request can not be handled. Please wait few minutes and try again.(free translation from local language) Because of error I started Excel services, but nothing changed. Problem 2: When XLS excel documeents are opened, it opens to the Office Excel client, but it request login. After login xls document is opened correctly. Why I need to login? Problem 3: When DOC word documeents are opened, it opens to the Office Word client, but it request login. After login doc document is opened correctly. Why I need to login?Kenny_I

SSRS Report based on SSAS Cubes doesn't show NULL values correctly

I have a SSRS report which is based on an SSAS Cube. In the Cube the formating of numeric fields that NULL values are properly shown as NULL values. In the Cube Browser and Excel this is shown correctly. However when I design the report already the query against SSAS shows these fields as "0" instead of NULL. Is there a way to fix this or is this a bug ?  

how to format server tag correctly?

I'm trying to display images in a GridView, but have a problem with this code:<asp:TemplateField> <ItemTemplate> <asp:Image ID="Image1" Height = "100" Width = "100" runat="server" //Error message here ImageUrl = = '<%# Eval("ID", "ImageProd.aspx?ImageID={0}")%>' /> //Warning here </ItemTemplate> </asp:TemplateField>The error message says: "Server tag is not correctly formatted."and the warning says: "Validation (ASP.Net): If this attribute value is enclosed in quotation marks, the quotation marks must match." I have this same warning on another interface where I just display one picture and not in a GridView and the image displays fine.Warning 7 Validation (ASP.Net): If this attribute value is enclosed in quotation marks, the quotation marks must match. C:\Users\karask\Desktop\Pejgan\AdminInnehåll.aspx 86 32 C:\...\Pejgan\

Problem with LayoutTemplate and the Login-control

Hi, I'm trying to make a login-form for my website, but i needed to customize the standard-layout, because the validators made the login-button move a couple of pixels to the right of the textfieldsWhen using the LayoutTemplate, I can't seem to get the login to work.. When adding a button with "Login" as the ID, shouldn't that button handle the loginprocess from the membership-providers validateuser-method?If not, and I'm supposed to handle the loginprocess myself? And if so, how do I get to the validateuser-method? I don't wanna have the method in two seperate places if I can avoid it..

general error login failed for user '' on windows 2008 in application that runs correctly on windo



we have a web application that one company prepared for us. this application read connection string from registery key in hkey_local_machine and connect to sql server 2005 database.

It worked correctly in windows server 2003. we changed our Server'OS to windows server 2008. but we have a problem to login. after try to login we see this error :

Login failed for user ''. The user is not associated with a trusted SQL Server connection.

Server Error in '/dabir' Application.

Login failed for user ''. The user is not associated with a trusted SQL Server connection.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Login failed for user ''. The user is not associated with a trusted SQL Server connection.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be

Initializing a Merge Subscription Without a Snapshot - doesn't operate correctly



I do the backup from the publisher, next I restore it at the subscriber using *pure* database.

next I attempt to create subscription using this db. of course, I use

SubscriptionSyncType.None for SyncType propery of the subscription.


1. nevertheless the merge agent downloads whole snapshot!

both data (bcp files) and the schema.

2. I get the *strange* error. below thelines from the log:

Applying the snapshot to the Subscriber

A dynamic snapshot will be applied from 'C:\DOCUME~1\...\LOCALS~1\Temp\DB$MAIN_DB1_Main_testReplFromBackup\'

Preparing table '__UserSyncOptions' for merge replication

Applied script '__UserSyncOptions_2.cft'

{call sp_MSsetconflicttable (N'__UserSyncOptions', N'MSmerge_conflict_Main___UserSyncOptions', N'DB\MAIN', N'DB1', N'Main')}

{call sp_MSsetconflicttable (N'__UserSyncOptions', N'MSmerge_conflict_Main___UserSyncOptions', N'DB\MAIN', N'DB1', N'Main')}

Incorrect syntax near 'Id'.

The merge process was unable to deliver the snapshot to the Subscriber. If using Web synchronization, the merge process may have been unable to create or write to the message file. When trou

Custom Data Processing Extension doesn't show but should be registered correctly.



I have a custom data processing extension that i can't see to get to work. I followed the steps like in :http://msdn.microsoft.com/en-us/library/ms155086.aspx to register the extension. Yet the extension does not show up in the data source list.

It's an extension made for ssrs 2008 and I want to use it on a SSRS 2008R2 instance. I don't have any reasons to believe that I did not configure the extension correctly, it's the same as the article and and the same on my 2008 instance.

I am using Reporting Services standard edition 2008 R2 with cumulative fix patch 4 so that should support extensibility.

The data sources that I migrated from 2008 that still refer to the extension give a message saying that the extension is not registered or configured correctly. But i swear I did it right.

Any other extension that I use did register fine, none of them are DPE's though.


My config:


  <Extension Name="SecurityDataProce

Why doesn't MonthCalendar draw correctly in Windows Vista?


Hi Everyone....

I use a MonthCalendar control into an UserControl, the MonthCalendar control is drawn correctly in Windows Xp but it appears very different in Windows Vista.

The control doesn't show Saturday and Sunday columns.

I tried to correct this issue using API function SetWindowTheme but issue persists... 

What can i do?


How To Set a Date Format In GridView Using ASP.NET 2.0

A very common desire is to set a column of a gridview to display just the month, day and year of a DateTime type. The problem is the by default, the HtmlEncode property of the boundfield attribute (
The problem is that if this field is enabled, you can not pass format information to the boundfield control. That is, if you try the following code, you will not get the desired result.

How to format and update GridView and DataGrid rows using JQuery

The behavior described in this question is as expected. When you set text of a cell in grid, it directly affects HTML that is going to be rendered. When you set text value of a cell, it means that you are setting innerText of the cell. The column that GridView creates for command fields (Edit, Delete and Select) are a (anchor) or button elements. So you can see what will happen if you set text value in that cell. It will wipe out those link or button controls and replace them with simple text string.

How to format datetime & date with century?

Execute the following Microsoft SQL Server T-SQL datetime, date and time formatting scripts in Management Studio Query Editor to demonstrate the usage of the multitude of temporal data formats available and the application of date / datetime functions.


Program for Format Conversion of An Image

.NET provides extensive support for image conversion. Any image can be processed from one format to another. Most common formats to which .NET have support for are .BMP, .EMF, .GIF, .ICO, .JPG, .PNG, .TIF and .WMF.

Get pixel format, raw format, property id list and property items image in VB.net - C#.net.

n this simple article you will learn that how we can get pixel format, raw format, property id list and property items image in VB and C#.net.

Get Pixel Format:

Image consists of pixels to get the format of the pixel we have a property named pixel format. This property returns an enumeration of pixel format. This enumeration tells the pixel format.

To demonstrate make a window application. Drag one button and a picture box on form.

Now write the following code on Button click event:

I thought this would be simple... Trying to create a login does an ajax check before submit


I have the standard .net login control that is working.  (Still learning .net after 15yrs of classic)

What I want to do is OnButtonClick run a javascript function (to do an ajax call to the db to check if login is valid or not) and if it returns true, then submit the form normally, else don't submit. The piece that I can't figure out, is how to correctly override the default click even to hit my JS routine and then submit the form properly afterwards.

Thanks ahead of time

Format Generic List Bound to Gridview


I have a generic list of a custom type. The custom type has a string and double.

I'm binding the list to a gridview and it outputs everything fine.

I'm trying to format the double column into a currency format. It is in a template field as I'm calculating a running total. I pass the value to a function that returns a double and adds the current value to a running total which I will show in the footer.

The format is not changing to currency as expected when using String.Format("{0:c}", GetTotal(Convert.ToDouble(Eval("Amount"))))

Any ideas on what might be going on and how to fix this?


Beginner: this doesn't make sense to me


Do you need and "empty" script tag in the head to run scripts that are in the body?  Also, can you run JQuery scripts if they're in the <head> tag?  The first sample only works if the JQuery script is in the form (and body) tag, not in the head - even if I add $(document).ready(function() { });

This works

<head runat="server">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" />
<script type="text/javascript">
<form id="form1" runat="server">
<a href="">Here is a link</a>
<script type="text/javascript">
$('a').click(function () {
alert("you clicked me!");


This doesn't work.  Notice I removed the second <script> tag from the head

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="serve

How to modify the login control



I'd like to record more information than the default control allows as well as perform actions with the input when the form is submitted but I'm having trouble figuring out how.

So firstly, if I want to record the middlename for example, how would I do that, and by default, where would it go if anywhere?
When the form is submitted, I'd like to take specific input, such as just the middlename for example, and write some linq to sql code to specify when and how it's stored.
In what event would I put this code?


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend