shers -2 Junior Poster

Hi,

I've created a registration form within a table. The image is attached. Capture14
The Batch section is not aligned to the left of the table column becuase of it's format. When I changed the Address text box to Multiline, that too has moved to the right. The Css Class for all textboxes are 'textentry'. Please advice.

I would also like to know how to classify the Registraion form into two, as there are Students and Teachers. Please could any expert suggest what would be the best design?

Thanks

shers -2 Junior Poster

:( that's sad. I will look for some free hosting then. The asp.net one sounds interesting. I will do a search on how that can be done. Thanks for the info.

Thanks

shers -2 Junior Poster

Hi,

I'm a newbie in web development. I'm almost half way through creating a web site. I'd wish to send this website to the client for viewing and testing. I have a database also attached with this web site. How do I send it? Please help.

Thanks

shers -2 Junior Poster

I did that, but no luck.

Thanks

shers -2 Junior Poster

I'm creating a WebSite in VWD 2010 Express. The Login page I created turns out to show the Email and Password that I once entered as part of testing to stay in the textbox. How do I delete it?

Thanks

shers -2 Junior Poster

'Class last studied' and 'Year' comes under 'Batch'

shers -2 Junior Poster

Hi,

I'm working with Visual Web Developer Express 2010. I have a registration form that looks as in the attached file. I'd like to get some suggessions on the design of the form as it doens't look professional. The 'Batch' section has to be improved. Please advice.

Thanks

shers -2 Junior Poster

Handling the exception came in when I noticed that if the user already exists, then it goes to the catch and the exception message is that the user already exists. This error has to be notified to the user. But the other kinds of errors never came to my mind though. But don't really know what other kinds of errors will occur and how to handle them.

BTW, I've enabled debugging. Thanks very much for the info and guidance.

Thanks

shers -2 Junior Poster

Sorry, I think I've got it to work. Here's the code:

protected void CreateUserButton_Click(object sender, EventArgs e)
    {
        try
        {
            var email = this.Email.Text;
            var password = this.Password.Text;
            var user = Membership.CreateUser(email, password, email);
            this.MessageLabel.Text = "Successfully created user.";
        }
        catch (Exception ex)
        {
            if (ex.Message != null)
            {
                CustomValidator err=new CustomValidator();
                err.CssClass = "failureNotification";
                err.IsValid=false;
                err.ErrorMessage=ex.Message.ToString();
                Page.Validators.Add(err);
            }
        }
    }

Is this correct?

Thanks

shers -2 Junior Poster

That great! I've anyway used the property grid to set the ValidationExpression. And all works fine. But I've got another problem now. If the user is already created, it doesn't show up in the ValidationSummary. How do I get to show the error there?

Thanks

shers -2 Junior Poster

I've attached the zipped project. Please have a look.

Thanks

shers -2 Junior Poster

Here's my code in the Register.aspx file.

<%@ Page Title="Register" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Register.aspx.cs" Inherits="Account_Register" %>

<asp:Content ID="HeaderContent" ContentPlaceHolderID="HeadContent" Runat="Server">
    <style type="text/css">
        .accessKey
        {
            display:none;
            position:absolute;
            z-index:5000;
            padding:3px;
            border:solid 1px black;
            background-color:#ffffe0
        }
        .style11
        {
            width: 341px;
        }
        .style12
        {
            text-align: right;
        }
    </style>
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <h2>
        Create a New Account
    </h2>
    <p>
        Use the form below to create a new account.
    </p>
    <span class="failureNotification">
        <asp:Literal ID="FailureText" runat="server"></asp:Literal>        
    </span>
    <div class="accountInfo">
        <fieldset class="register">
            <legend>Account Information</legend>
            <table style="width: 510px; height: 200px">
                <tr>
                    <td>
                        <asp:Label ID="FullNameLabel" runat="server" AssociatedControlID="FullName">Full Name:</asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="FullName" runat="server" CssClass="textEntry" height="19px" 
                            width="309px"></asp:TextBox>
                    </td>
                    <td>
                        <asp:RequiredFieldValidator ID="FullNameRequired" runat="server" ControlToValidate="FullName" 
                            CssClass="failureNotification" ErrorMessage="Full Name is required." 
                            Display="Dynamic" ToolTip="Full Name is required.">*</asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                       <asp:Label ID="EmailLabel" runat="server" AssociatedControlID="Email">Email:</asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="Email" runat="server" CssClass="textEntry" height="19px" 
                            width="309px"></asp:TextBox>
                    </td>
                    <td>
                        <asp:RequiredFieldValidator ID="EmailRequired" runat="server" ControlToValidate="Email" 
                            CssClass="failureNotification" ErrorMessage="Email is required." 
                            Display="Dynamic" ToolTip="Email is required.">*</asp:RequiredFieldValidator>
                        <asp:RegularExpressionValidator ID="EmailCheck" runat="server" 
                            CssClass="failureNotification" Display="Dynamic" 
                            ErrorMessage="Please enter a valid email address." 
                            ControlToValidate="Email">*</asp:RegularExpressionValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="Password" runat="server" CssClass="textEntry" height="19px" 
                            TextMode="Password" width="309px"></asp:TextBox>
                    </td>
                    <td>
                        <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password" 
                            CssClass="failureNotification" ErrorMessage="Password is required." 
                            Display="Dynamic" ToolTip="Password is required.">*</asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="ConfirmPasswordLabel" runat="server" AssociatedControlID="ConfirmPassword">Confirm Password:</asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="ConfirmPassword" runat="server" CssClass="textEntry" 
                            height="19px" TextMode="Password" width="309px"></asp:TextBox>
                    </td>
                    <td>
                        <asp:RequiredFieldValidator ID="ConfirmPasswordRequired" runat="server" ControlToValidate="FullName" 
                            CssClass="failureNotification" 
                            ErrorMessage="Confirm Password is required." Display="Dynamic" 
                            ToolTip="Confirm Password is required.">*</asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="PhotoUploadLabel" runat="server" AssociatedControlID="PhotoUpload">Upload Photo:</asp:Label>
                    </td>
                    <td>
                        <asp:FileUpload ID="PhotoUpload" runat="server" CssClass="textEntry" 
                            Height="19px" Width="309px"></asp:FileUpload>
                    </td>
                </tr>
                </table>
        </fieldset>
        <p class="submitButton">
            <asp:Button ID="CreateUser" runat="server" CssClass="textEntry" 
                Text="Create User" …
shers -2 Junior Poster

androtheos, thanks for the code. I added it to the click event of the button, but there is some design issue and I can't figure out what's wrong as I'm just a novice. The click is not working. I've attached a snapshot of the design and how it looks on the browser. Please help.

Capture8Capture11

Thanks

shers -2 Junior Poster

But I wish to use the email to login. So how do I go about it please?

Thanks

shers -2 Junior Poster

Thanks very much for the advice. I would definitely use the first method you mentioned.

Btw, I have deleted the CreateUserWizard and created another on with my own labels and textboxes. For that reason, it does not work. This is the error I get.

RegisterUser: CreateUserWizardStep.ContentTemplate does not contain an IEditableTextControl with ID UserName for the username.

Here's my source page code for the registration page:

<%@ Page Title="Register" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Register.aspx.cs" Inherits="Account_Register" %>

<asp:Content ID="HeaderContent" ContentPlaceHolderID="HeadContent" Runat="Server">
    <style type="text/css">
        .accessKey
        {
            display:none;
            position:absolute;
            z-index:5000;
            padding:3px;
            border:solid 1px black;
            background-color:#ffffe0
        }
    </style>
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<asp:CreateUserWizard ID="RegisterUser" runat="server" EnableViewState="false" OnCreatedUser="RegisterUser_CreatedUser">
        <LayoutTemplate>
            <asp:PlaceHolder ID="wizardStepPlaceholder" runat="server"></asp:PlaceHolder>
            <asp:PlaceHolder ID="navigationPlaceholder" runat="server"></asp:PlaceHolder>
        </LayoutTemplate>
        <WizardSteps>
            <asp:CreateUserWizardStep ID="RegisterUserWizardStep" runat="server">
                <ContentTemplate>
                    <h3>
                        CREATE A NEW ACCOUNT
                    </h3>
                    <p>
                        Use the form below to create a new account
                    </p>
                    <span class="failureNotification">
                        <asp:Literal ID="ErrorMessage" runat="server"></asp:Literal>
                    </span>
                    <asp:ValidationSummary ID="RegisterUserValidationSummary" runat="server" CssClass="failureNotification" ValidationGroup="RegisterUserValidationGroup" ></asp:ValidationSummary>
                    <div class="accountInfo">
                        <fieldset class="register">
                            <legend>Account Information</legend>
                            <p> 
                                <asp:Label ID="lblFName" runat="server" AssociatedControlID="txtFName">Full Name:</asp:Label>
                                <asp:TextBox ID="txtFName" runat="server" CssClass="textEntry"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="FNameRequired" runat="server" ControlToValidate="txtFName"
                                    CssClass="failureNotification" ErrorMessage="Full Name is required." ToolTip="Full Name is required."
                                    ValidationGroup="RegisterUserValidationGroup">*</asp:RequiredFieldValidator>
                            </p>
                            <p> 
                                <asp:Label ID="lblEmail" runat="server" AssociatedControlID="txtEmail">Email:</asp:Label>
                                <asp:TextBox ID="txtEmail" runat="server" CssClass="textEntry"></asp:TextBox>
                                <asp:Label ID="lblMsg1" runat="server" CssClass="Info">used as login Id.</asp:Label>
                                <asp:RequiredFieldValidator ID="EmailRequired" runat="server" ControlToValidate="txtEmail"
                                    CssClass="failureNotification" ErrorMessage="Email is required." ToolTip="Email is required."
                                    ValidationGroup="RegisterUserValidationGroup">*</asp:RequiredFieldValidator>               
                                <asp:RegularExpressionValidator ID="EmailCheck" runat="server" ControlToValidate="txtEmail"
                                    CssClass="failureNotification" Display="Dynamic" ErrorMessage="Please enter a valid email address."
                                    ValidationGroup="RegisterUserValidationGroup"
                                    ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">*</asp:RegularExpressionValidator>  
                            </p>
                            <p>
                                <asp:Label ID="lblPwd" runat="server" AssociatedControlID="txtPwd">Password:</asp:Label>
                                <asp:TextBox ID="txtPwd" runat="server" CssClass="passwordEntry" TextMode="Password"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="txtPwd"
                                    CssClass="failureNotification" ErrorMessage="Password is required." ToolTip="Password is required."
                                    ValidationGroup="RegisterUserValidationGroup">*</asp:RequiredFieldValidator>
                                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" Display="Dynamic" ControlToValidate="txtPwd"
                                    ErrorMessage="Password must be 6-12 …
shers -2 Junior Poster

Hi,

Thanks for your reply. I'm using .NET Framework 4 and Visual Web Developer 2010 Express. I started with creating a new Web Site which already had few pages. So with my little knowledge, I think it should be webforms. I modified the Registration Page to match my requirements, checked with the RequiredFieldValidator and everything goes well. But when I click on the 'Create User' button, the data should go into the database table. And also a message should be displayed on the same page for the user to know that the User is created.

Thanks

shers -2 Junior Poster

Hi,

I'm quite new to Web Development. I'm creating a web site and it has a Registration Page where I managed to create the form. But when the user clicks on the 'CreateUser' button, how do I display a message on the form to show that the User is created. And also, at the moment, I don't know where the user details are being created. I wish to add the details to a Login Table in the SQL Database. How do I go about it please?

Thanks

shers -2 Junior Poster

Hi,

I have a combo box and a property grid in a form. The combo box contains 2 items. If one item is selected, two properties are listed in the property grid. These properties should have a dropdown that contains a list of items. I have two string arrays that contain the values for these properties. Can I use one TypeConverter that inherits StringConverter for these lists to be displayed in two different properties? That is, with one TypeConverter class, can I populate both the lists? I will also have to do the same with the other items in the combo box.

Thanks

shers -2 Junior Poster

I'm looking for help in PropertyGrid. The link is for basic controls which I need.

Thanks

shers -2 Junior Poster

Thanks for your reply. Here's my code.

Public Class Grs

    Private m_FlC As List(Of WS.FCode)
    Private m_GrT As List(Of WS.GType)

    Public Sub New()

        m_FlC = FCode.ToList
        m_GrT = GTypes.ToList
    End Sub

    Public Property FlC() As List(Of WS.FCode)
        Get
            Return m_FlC
        End Get
        Set(ByVal value As List(Of WS.FCode))
            m_FlC = value
        End Set
    End Property

    Public Property GrT() As List(Of WS.GType)
        Get
            Return m_GrT 
        End Get
        Set(ByVal value As List(Of WS.GType))
            m_GrT  = value
        End Set
    End Property
End Class


'The code in the form that contains the PropertyGrid

    Private Sub frmSpace_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        m_Grs = New Grs()   
        PropertyGrid1.SelectedObject = m_Grs
    End Sub

Thanks

shers -2 Junior Poster

Hi,

I'm working on a propertygrid that has two items. The value of these items has to be taken from a database table. The table contains two columns, but I only want one column data to be displayed in the propertygrid. When the user selects one value from the drop down, the corresponding value has to be recognized. Is this possible please?

Thanks

shers -2 Junior Poster

Great!! Thanks very much! I commented out the InitializeComponent() and everything works fine. Thanks again.

shers -2 Junior Poster

Hi,

I have a User Control that contains a Button. This button works for the first click. But the Click Event is not fired in the second click. Please help.

Here's my code:

Public Sub New()
        MyBase.New()
        ' This call is required by the Windows Form Designer.
        InitializeComponent()

        ' Add any initialization after the InitializeComponent() call.
        Dim doc As Document = Application.DocumentManager.MdiActiveDocument
        AddHandler doc.CommandEnded, AddressOf Me.plineCommandEnded
    End Sub

Private Sub ucTools_Disposed(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Disposed
        Dim doc As Document = Application.DocumentManager.MdiActiveDocument
        RemoveHandler doc.CommandEnded, AddressOf Me.plineCommandEnded
    End Sub

Private Sub btnSpace_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSpace.Click
        InitializeComponent()
        Dim doc As Document = Application.DocumentManager.MdiActiveDocument
        CmdStarted = True
        doc.SendStringToExecute("_PLINE" & vbCr, True, False, True)
End Sub

Thanks

shers -2 Junior Poster

I have managed to get the row needed with a value in a known field, into a data row. In this datarow, taken from the main table, I now have to search for another value and get it's column name. There are 37 columns in this table from where I have retrieved the datarow.

Thanks

shers -2 Junior Poster

Hi,

I have a datarow retrieved from a datatable. I have a value that exists in some column in the datarow. I want to find which column this value is in. How can I achieve this please?

Thanks

shers -2 Junior Poster

Hi,

I have a value which I don't know which column this belongs to in the table. So is there a way I get get those rows that contain this value using query?

Thanks

shers -2 Junior Poster

Hi,

I have a function that returns all the database tables with the data items in it. Is it possible to search for a value in all tables and return the table name and the datarow that contains the value?

Thanks

shers -2 Junior Poster

Hi,

I'm working on a C# Windows Application which has a Web Service. I'd like to know how to communicate with the Web Service using XML. To be precise, I have a data set that has to go to the Database via Web Service. So I'd want to send this data using XML to the Web Service. How would I do that please?

Thanks

shers -2 Junior Poster

That's fantastic!! That worked. I had to crop the image though. Thanks.

shers -2 Junior Poster

I drew an image in a picturebox with the image height as picturebox height and image width as picturebox width. The image is placed somewhere on the center of the picturebox. My intention is to scale the image to fit to the picturebox. How do I do this please?

Thanks

shers -2 Junior Poster

Thanks

shers -2 Junior Poster

Here's my code so far:

Dim g As Graphics = pb.CreateGraphics()
                    Dim x As Integer = CInt(CurrentRecord(4))
                    Dim y As Integer = CInt(CurrentRecord(6))
                    Dim width As Integer = CInt(CurrentRecord(5))
                    Dim height As Integer = CInt(CurrentRecord(7))
                    Dim rect As New Rectangle(x, y, width, height)
                    Dim redPen As New Pen(Color.Black, 2)
                    g.DrawRectangle(redPen, rect)
                    Dim mtx As New Matrix
                    redPen.Dispose()
                    g.Dispose()

I want to flip the rectangle upside down.

Thanks

shers -2 Junior Poster

Yes, I do notice delays in the line where the data is writing to the cell.

Here's my code:

For Each row As String() In lstItems
      If row(3) = "Yes" Then
            xs.Cells(row, 1).Value = row(0)
            xs.Cells(row, 2).Value = row(1)
            xs.Cells(row, 17).Value = row(2)
            row += 1
       ElseIf row(3) = "No" Then
            xs.Cells(hrow, 3).Value = row(0)
            xs.Cells(hrow, 4).Value = row(1)
            xs.Cells(hrow, 17).Value = row(2)
            hrow += 1
     End If
Next

Thanks

shers -2 Junior Poster

Thanks all! I've used split.

shers -2 Junior Poster

Hi,

I have a string like "a_b_c_d". How do I get only c out of this string?

Thanks

shers -2 Junior Poster

3 cells. In one case, cells 1, 2, 17 and in a second case, cells 3, 4, 17.

Thanks

shers -2 Junior Poster

Hi,

I have done some code to write to Excel from a String Array of 3 items. These 3 items are written to columns 1, 2, 17 or 3, 4, 17, depending on the value of the 3rd item in the array. For certain Excel files, this is taking too long to write. Is it because I'm writing cell by cell? Is there any other way of writing faster to Excel?

Thanks

shers -2 Junior Poster

Hi,

I have a collection of (String, Integer). I have taken it into a String() Array and then added to a List(Of String()). I then need to find the duplicates in this list and if found, then add up the corresponding integers. How do I do this? Am I using the right Collection? If not which one would be the best?

Thanks

shers -2 Junior Poster

Hi,

Could anyone tell me how to flip rectangles in picturebox?

Thanks

shers -2 Junior Poster

It's currently in a string array which is fine with me. I now get the x value, y value, width and height from this array. How do I draw a rectangle based on these values in the picturebox?

Thanks

shers -2 Junior Poster

Hi,

I realised that it's a CSV and I got to read the CSV file successfully. I will have to render image into a picture box, which I'm confused about how to do.

Thanks

shers -2 Junior Poster

Please find attached.

Thanks

shers -2 Junior Poster

The field file looks like this:

Reverse 1
21: MerchXSqueeze Boolean, Obsolete
22: MerchYMin Integer, min=0, max=9999, default=0
23: MerchYMax Integer, min=0, max=9999, default=0
24: MerchYUprights Integer, min=0, max=9999, default=0
25: MerchYCaps Integer, min=0, max=9999, default=0
26: MerchYPlacement Enumerated, 4 values

It's just a part of the file.

Thanks

shers -2 Junior Poster

The file contains numbers and characters. There is a file with Fields denoting what these numbers and characters means. And all these files are text files.

Thanks

shers -2 Junior Poster

Hi,

I have a file from the client which is a text file. I have to decode the file to a graphical representation. Is there any way I can do it?

Thanks

shers -2 Junior Poster

Somebody please help me!!

This query would work if some experts give me a helping hand.

Dim q = From b in Item2 Join a in Item1 on b.Value Equals a.Value Select New With {b.Value, .Count = b.Count + a.Count}

This gives me a list of only that's common in both Item1 and Item2. I want the other items that were there in Item1 to still remain, add those in Item2 that are not there in Item1, and those common between Item1 and Item2 to have the Count value added.
Please help.

I cannot find another option :(

Thanks

shers -2 Junior Poster

I'm sorry, I'm stuck again.

I have managed to get two IEnumerables with LINQ. They are like this.

A contains
Value: x Count: 4
Value: y Count: 2
Value: z Count: 5

B contains
Value: n Count: 3
Value: y Count: 1

I wish to join these values to get one List, so that the values look like this

Value: x Count: 4
Value: y Count: 3
Value: z Count: 5
Value: n Count: 3

How can I get this to work? Please help.

Thanks

shers -2 Junior Poster

Hi,

I have an IEnumerable as a result of LINQ, which contains Value and Count. After I get the result, I want to do a string manipulation on the Value and make the corresponding Count to half. Is that possible with LINQ?

Thanks

Unhnd_Exception commented: Glad I wasted my time doing this. -2
shers -2 Junior Poster

Hi,

How do I run a form that has a progress bar on a separate thread from another form?

Thanks

shers -2 Junior Poster

HI,

I created an rtf file containing images in C# using rtf tags. But when I convert the file to pdf, the image is shrinked. What could be the reason?

Thanks