Showing posts with label Visual Studio 2010. Show all posts
Showing posts with label Visual Studio 2010. Show all posts

Thursday, March 15, 2012

How to fix visual studio 2010 unable to open CSS styleSheet Error

I got an error when i try to open the CSS stylesheet under my web project.

the Error Message Box show this Message "the operation could not be completed"

I google the web with this error message. there are various suggestion or solution. but None of them apply for my case. I tried to re-apply the Visual Studio SP1 as some one suggestion in MSDN forum. I still was unable to fix my issue.

The root cause of this issue is that i had upgrade my Visual Studio 2010 to SP1. It looks like the upgrade cause the conflict with Visual Studio web Standard.

after i download the  Web Standards Update for Visual Studio 2010 SP1 from the following web link.
Web Standards Update for Microsoft Visual Studio 2010 SP1

I installed the patch and reboot my PC. the error message box is gone and i can open and edit the CSS file inside Visual Studio 2010

Tuesday, September 20, 2011

use Validator and ValidationSummary in ASP.Net Validation

Today I implemented a form for user submit since i need to ensure all the required fields are filled by the user

I use RequiredFieldValidator to control the Mandatory fields validation.


the code works perfectly fine, all the erorr message displayed after user click 
submit button.
 
after i added another panel with another submission sesseion. 
no matter which button is trigger
all the error messages are shown. there is a ValidationGroup Property
in control which is availble for .net 3.5 and later. when the button is clicked
by the user, only the specific Validation Group that specified in the Button
validationGroup Property will be triggered and validated. All the Error Message 
will only shown  

here is the sample code:

    <asp:ValidationSummary ID="ValidationSummaryControl" runat="server"   
HeaderText="Validation Errors:" ValidationGroup="RateSubmit" /> 
 
<asp:ValidationSummary ID="ValidationSummary1" runat="server"   
HeaderText="Validation Errors:" ValidationGroup="ExpenseSubmit" /> 
 
      
<td class="style2">
<asp:Label runat="server" ID="lblDateFrom" Text="Date From: " Font-Bold="true">
</asp:Label></td>
<td class="style3">
<asp:TextBox runat="server" ID="txtDateFrom"></asp:TextBox>
 <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator3" Display="None" 
ErrorMessage="Please fill Expense Date From" ControlToValidate="txtDateFrom" 
ValidationGroup="ExpenseSubmit"  ></asp:RequiredFieldValidator>
 
<asp:Button runat="server" ID="btnExpenseSubmit"  Text="Submit" causesvalidation="true"  
onclick="btnExpenseSubmit_Click" ValidationGroup="ExpenseSubmit" /></td>
 
    <td class="style2">
<asp:Label runat="server" ID="Label3" Text="Subaru Milage Rate: " Font-Bold="true"></asp:Label></td>
<td class="style3">
 <asp:TextBox runat="server" ID="txtMilagRate" ValidationGroup="RateSubmit"></asp:TextBox> 
 <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator10" Display="None"  
ErrorMessage="Please fill Milage Rate Field" ControlToValidate="txtMilagRate" 
ValidationGroup="RateSubmit"></asp:RequiredFieldValidator>
                    </td>
           </tr>
           
                <td class="style5" align="right">
                    <asp:Button runat="server" ID="btnRateSubmit"  
Text="Submit" onclick="btnRateSubmit_Click" 
ValidationGroup="RateSubmit" CausesValidation="true" /></td>