|
I have a page that has a tab control and currently contains two tabs. The first tab contains information about students (name, address, phone #, etc.) and most of the text boxes have either a regex, required field (or both) validators with a validation group name of StudentInfoVG. There is also a button used to update the student information with a validation group name of StudentInfoVG.
The second tab, which has information about the students grade and performace, has an editable grid view bound to a SQL data source and some of text boxes in the edit item template have only a required field validator. These have a validation group name of GradeVG. The grid view also has a command field to enable the editing of a row also with a validation group name of GradeVG:
<asp:CommandField ButtonType="Button" ShowEditButton="True" ValidationGroup="GradeVG">
<ControlStyle Font-Size="11px" />
<ItemStyle Font-Size="11px" />
</asp:CommandField>
I can update the student information and grade information fine, but if I do the following steps in order:
1. Start on the first tab (student info.)
2. Go to the second tab (grade info.) and click the edit button to enable editing of a specific row
3. Click the now visible cancel button to cancel the editing
4. Go back to the first tab (student info.)
5. Change a field (for example the student's city)
6. Click the update button to update the student information
The student's information does not update. I even set a break point on the method that handles the update buttons click event and it does not fire. However, if I do all the steps but instead of changing a field I leave a required field blank I get a message in the validation summary. So in the previous example, if I left the student's city blank the validation summary would say "Student's city required." This indicates to me that validation is being performed, and in the above example the validation passes since I get no error message, but the click event is not "fully" firing.
Any suggestions on why everything works fine except when I go to edit a row on the second tab panel and cancel it. It seems that the update button on the first tab is doing validation on the items in the second tab even though they are in different validation groups. Am I missing something here or is this just some weird quirk of tab containers and validation? I've been trying to tweak this for several hours with no luck so any help or suggestions would be greatly appreciated. Thanks in advance for any help you can provide.
**UPDATE**
I have been trying to narrow down exactly when the button loses it's ability to update the student info and it has nothing to do with the grid view on the second tab panel; it has to do with the tab panel itself. If I do the following steps in order the same results occur (where the update button's method will not fire):
1. Start on the first tab (student info.)
2. Go to the second tab (grade info.) and do not do anything
3. Go back to the first tab (student info.)
4. Change a field (for example the student's city)
5. Click the update button to update the student information
modified on Friday, July 29, 2011 3:47 PM
|
|
|
|
|
how can i run google maps api in ASP.NET?
|
|
|
|
|
|
String FileName = HttpContext.Current.Server.MapPath(@"../Excel/MyExcel.xls");
Excel.Application xlApp;
Excel._Workbook xlBook;
Excel._Worksheet oSheet;
Excel.Range oRng;
Excel.Range RRange;
xlApp = new Excel.Application();
xlApp.Visible = true;
xlBook = xlApp.Workbooks.Open(fileCopypath, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value);
xlApp.Workbooks.Open not working when i upload application on server.
i give full permission to a folder name Excel(IN root) .... but nothing happend.
this code is working fine on my local system.
tell me what i have to do.
|
|
|
|
|
Hello,
For one project, can we have a part of it as web app and a part as web site? Is there any special set up that needs to be included?
What I have found is that compiling a web app is taking a long time, to see the code behind changes.
Thanks!
|
|
|
|
|
No, you cannot. A project can either be set up as a website or as a web application.
|
|
|
|
|
hi
who i do create dinamic tooltip for asp controls ?
i want read contant tooltip from database
thanks
|
|
|
|
|
Well, it's "hard" to understand your question because of used poor English and not clear question. Which is your real problem on your task?
I Love T-SQL
"VB.NET is developed with C#.NET"
If my post helps you kindly save my time by voting my post.
www.cacttus.com
|
|
|
|
|
Sir;
you can use on of the following:
string content = ReadFromDatabase();
control.Attributes.Add("title",content);
<HTMLControl title="<%# Eval("Content") %>" /> or
<asp:WebControl ToolTip="<%# Eval("Content") %>" />
Help people,so poeple can help you.
|
|
|
|
|
Hi,
I need some sample XSLt for XSL:for-each-group function.
Thanks
Rajesh
|
|
|
|
|
Then go search for it and next time use the appropriate forum; this has nothing to do with asp.net
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hey, can anyone tell me how to export multiple crystal reports to a single destination PDF? Plz help
|
|
|
|
|
|
Thanx alot..!!!! its Working..
|
|
|
|
|
<asp:TextBox ID="txtExchangePartQty" runat="server" onfocus="if(this.value==this.defaultvalue) this.value='';" value="Quantity..." Width="120px">
</asp:TextBox>
<asp:FilteredTextBoxExtender ID="ftbeQty" runat="server" TargetControlID="txtExchangePartQty" ValidChars="1234567890" />
When I dont use FilteredTextBoxExtender, as an initial value, inside the texbox "Quantity..." appears but when I use FilteredTextBoxExtender during the loading of the page, for a moment I see that initail value but then it dissappears.
The cause is for it is TheFilteredTextBoxExtender, any idea why this is happening and how can I work out this problem?
|
|
|
|
|
Hi,
In FilteredTextBoxExtender you specified ValidChars="1234567890" this is why
TextBox value "Quantity..." is not displayed.
|
|
|
|
|
Yeah thats right. Not being careful enough to figure it out by myself LOL
|
|
|
|
|
On a previous site I designed I had the ability for the company to upload documents that were stored directly in SQL database. Now I'm working on a different site in which the client needs to be able to upload images directly to a database. So I decided to reuse my code and it didn't work. My markup for the ASPX page for the upload control is:
<tr>
<td>
<asp:AsyncFileUpload ID="ImageUploader" runat="server"
UploaderStyle="Modern" ThrobberID="myThrobber"
UploadingBackColor="Yellow"
CompleteBackColor="Green" ErrorBackColor="Red" />
</td>
<td>
<asp:Image ID="myThrobber" runat="server" ImageUrl="~/Images/uploading.gif"
Visible="true" />
</td>
</tr>
In the code behind I have a method that actually stores in the ImageUploader file contents to the database called StoreFile . I stepped through the code and found that the problem is in the very beginning where I try to read the bytes of the ImageUploader.FileContent :
Dim bufferLen As Integer = 8040
Dim br As BinaryReader = New BinaryReader(ImageUploader.FileContent)
Dim chunk As Byte() = br.ReadBytes(bufferLen)
Through the debugger I see that chunk has no data in it after the read operation. I figured that there was a problem with the ImageUploader.FileContent having no data. However the length of the file content is 48,336 for the image I'm doing the testing with. So if the file content has data, why is the read operation not placing it into the byte array? I even thought that it might have something to do with the post back of the update button so I even included parameters to pass the ImageUploader.FileContent stream by reference from the button's click event to StoreFile method, albeit with no luck.
Any help would be greatly appreciated since no matter how I try and modify this code, the read operation does not read the file contents data. Thanks in advance.
|
|
|
|
|
Hi
I am using Visual Web Developer 2010 Express (with C# as code-behind) to develop a website.
I have created a custom MembershipProvider and I have specified that in the web.config that
minRequiredPasswordLength="6"
minRequiredNonalphanumericCharacters="0"
I am not sure where and how to use these values.
I have done the following:
I have added a CustomValidator to the Password textbox in the CreateUserWizard .
<asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label>
<asp:TextBox ID="Password" runat="server" CssClass="passwordEntry" TextMode="Password"></asp:TextBox>
<asp:CustomValidator ID="CustomValidator_PW" runat="server" ControlToValidate="Password"
OnServerValidate="CustomValidate_PW" ValidateEmptyText="true" Display="Dynamic"
ErrorMessage="" ForeColor="Red" ValidationGroup="RegisterUser">
</asp:CustomValidator>
<asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password"
CssClass="failureNotification" ErrorMessage="Password is required." ToolTip="Password is required."
ValidationGroup="RegisterUser">*</asp:RequiredFieldValidator>
And a server-side method in the code-behind:
protected void CustomValidate_PW(object source, ServerValidateEventArgs args)
{
CustomValidator cv = (CustomValidator)source;
string pw = RegisterUser.Password;
if (pw.Length < Membership.MinRequiredPasswordLength)
{
cv.ErrorMessage = "Minimum Password length is " + Membership.MinRequiredPasswordLength;
args.IsValid = false;
}
if (Membership.MinRequiredNonAlphanumericCharacters > 0)
{
int count = 0;
for (int j = 0; j < pw.Length; j++)
{
if (!char.IsLetterOrDigit(pw[j]))
{
count++;
}
}
if (count < Membership.MinRequiredNonAlphanumericCharacters)
{
cv.ErrorMessage = "Password requires " + Membership.MinRequiredNonAlphanumericCharacters + " non-Aphanumeric characters";
args.IsValid = false;
}
}
}
Is there a better way or better place to do this?
All help will be appreciated.
Kobus
|
|
|
|
|
my computer have ms-sql 2005, 2008.
i select web.config like this
<add key="dsn" value="data source=localhost;initial catalog=PERSON_database;uid=sa;pwd=1111;persist security info=False;packet size=4096"/>
but i only connect mssql2005.
how can i connect mssql 2008?
hi
My english is a little.
anyway, nice to meet you~~
and give me your advice anytime~
|
|
|
|
|
I think the connection string you mentioned is for database in 2005. Similarly add another connection string pointing to database in sql 2008.
|
|
|
|
|
It means a SQL 2005 server instance has been installed as the default instance, which enables you to specify localhost as the data source. SQL 2008 server must have been installed as a named instance (since there can be only one default instance). Find out the name of the named instance and use it in your connection string like this.
data source=localhost\mySql2k8instance
You can find the name of your SQL 2008 instance by looking at the list of serivces in services.msc .
|
|
|
|
|
Hello friends
I am using gridview in one of my application.In this application i am binding gridview to data table. In gridview one column is invisible(visible="false"). Now i want to take the value from invisible gridview column and display it into text box.
But i am not able to do it so please help me ASAP.
|
|
|
|
|
Just loop through the gridview.
List<string> gridviewDatas = new List<string>();
for(i=0;i>[GridviewID].Rows.Count;i==)
{
gridviewDatas.Add([GridviewName].Rows[i].Cells[CellIndex].Text);
} ------
[TextBoxID].Text = GridviewName.Rows[the row number that you need the data of].Cells[put the cell number that you want the data of].Text;
-----
Sometimes I can not retrieve the data. Before binding the gridview make the columns visible and after binding make the visibilty property false that you dont want to see.
Something like;
for(i=0;i>[GridViewName].Columns.Count;i++)
{
[GridviewName].Column[i].Visible = true;
}
GridviewName.DataSource = dtsrc;
GridviewName.DataBind();
[GridviewName].Column[index].Visible = false;
|
|
|
|
|
Don't set it to invisible. If you do, the program won't even bother sending it along.
Use CSS and give that column (and it's Header) a value like this:
CssClass="NotShown"
where NotShown is a CSS class like this:
.NotShown
{
display: none;
}
The data will be there in the grid, but not visible in the browser, and you can access it in the code behind like this or similar:
GridViewRow selectedRow = GRID.Rows[index];
TableCell HiddenColumn = selectedRow.Cells[5];
(in this example, the hidden column is number 5, of course)
|
|
|
|