|
I get this error:
Cannot cast 'grid.Rows[index].Cells[5].Controls[0]' (which has an actual type of 'System.Web.UI.LiteralControl') to 'System.Web.UI.WebControls.TextBox'
p.s. some of the gridview fields are templatefields.
Anythoughts please?
|
|
|
|
|
I even converted it to literalcontrol but returns just spaces in a string.
Not sure what is wrong?
|
|
|
|
|
Solved by referring to the correct control names...
Many thanks
|
|
|
|
|
I create 10 radcombobox and fill the values 1 to 10 in each Radcombobox.
This has done in code behind using c#.
I want to write the event for the radcombobox in the design code.
Evnnt is OnClientSelectedIndexChanged.
And i want to call the event from code behind.
During calling the java script function i have to pass some parameters.
This parameters may be the number of comboboxes and selected combobox id.
In the javascript function I have to done some operations using my logic.
If anybody know please post the answer.
|
|
|
|
|
Hi,
I have Gridview in which there is 1 textbox and requiredfield validator , this gridview is inside updatepanel but the required field is not firing on async postback.
|
|
|
|
|
One way,you can validate the textbox from javascript..
Cheers!!
Brij
|
|
|
|
|
I agree with you Brij.
This will avoid unnecessary complexity.
|
|
|
|
|
I need some hacks i know that javascript can solve my problem but because there is already tested validation controls i want to implement that.
|
|
|
|
|
From javascript,I mean fire the validatiors from a javascript functin .You just need to give a group name to your validators that you want to get fired on postback.First execute a js fubction that will be executed before any postback and in that js function,put the code
Page_ClientValidate('GroupName') it will fire all the validators with this GroupName and return true or false accordingly.Based on it you can take decision whether to postback or not.
Cheers!!
Brij
|
|
|
|
|
i have following datalist in WhatsNews.aspx page.
<br />
<asp:datalist id="DL1" runat="server" ItemStyle-BorderColor="#c7c7c6" CssClass="HomePageTitles"><br />
<ItemTemplate> <br />
<asp:HyperLink Runat ="server" Target="_Parent" NavigateUrl ='<%#"page.aspx?id=" + DataBinder.Eval(Container.DataItem, "NewsArticleID").ToString()%>' ID="Hyperlink1"> <br />
<%#DataBinder.Eval(Container.DataItem, "NewsArticleTitle")%> <br />
</asp:HyperLink> <br />
</ItemTemplate> <br />
<AlternatingItemStyle BackColor="#FFFFFF" /><br />
<ItemStyle BackColor="#e7e3e3" BorderColor="#e7e3e3" /><br />
</asp:datalist> <br />
in above code i am setting to open the links in parent window.
and in home page i am adding WhatsNew.aspx using iframe.
<br />
<iframe frameborder="0" marginheight="1" marginwidth="1" hspace="1" width="390" height="450px"<br />
scrolling="no" src="WhatsNew.aspx"></iframe><br />
when i open home page and click a link in whatsnew section, IE 8 opening the links in a new window.
but firefox 3.5.7 opens in parant window, just like i want.
how can i make IE 8 also open the links in parent window?
|
|
|
|
|
|
Hello,
I am trying to build a master detail functionality...
At present, there is a web page i.e. page1.aspx with search functionality. When the criteria is entered then the search button can be clicked and then the GridView gets populated with data. In this GridView, a number of the fields of the selected row can be edited as per business requirement.
Now I would like the user to be able to see and edit more fields related to the selected row in the gridview. These are extra fields which are not viewable in the gridview.
Question:
Is it best to have another page i.e. page2.aspx to see and edit these extra fields or is it better to have these extra fields (One in each control) just below the gridview in page1.aspx ?
Thanks
|
|
|
|
|
If it is just few items, mostly single-line text / dropdown values then do it on the same page. If you need to edit more than one multi-line text then use page2.aspx
|
|
|
|
|
There are about 25 fields.
|
|
|
|
|
Then it would be best to do it on a 2nd page. You can consider using AJAX pop-ups instead of conventional postback or pop-up.
|
|
|
|
|
How will that work as opposed to be redirected to page1.aspx?
|
|
|
|
|
Based on my work experience, I understand that users generally don't like to open a new page just in order to edit some values pertaining to a single classification. In simpler words, users would be happy if they can view and edit the data on the same page instead of navigating to a different page and then coming back to results page.
So, if you can let them edit it on the same place nothing like it. Since, in this case the users have to edit close to 25 fields, the users wouldn't be happy to edit so many fields in-line. So, we have to either redirect them to a new page or show the edit page in a pop-up.
Any day naive users would be happy with pop-ups, but advance ones hate them and might have them disabled. So the safe option would be to use a AJAX modal pop-up extender and display the edit form in AJAX pop-up. Naive users would be happy and advance ones wouldn't complain.
|
|
|
|
|
The buttons are not able to get focus if we set tabindex on safari. While googling i
got few settings to be done in Safari browser. But this we can't tell the user to do.
So anyone please help me to do it through coding.
Thanks
|
|
|
|
|
i have upload a website which run fine but it upon show an error message which show that page cann't b displayed due to high trafic while there are only 3 user accessing the sites.
amirzada
|
|
|
|
|
I have some files listed on a listbox and want to upload them to the server. The values doesn't need to be selected. But I can't even get it working. Below is my source code:
Protected Sub uploadButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles uploadButton.Click
If (foundFilesList.Items.Count > 0) Then
Dim _fileUpload As New FileUpload()
For i As Integer = 0 To foundFilesList.Items.Count - 1
_fileUpload.SaveAs("~\InputFiles\" & foundFilesList.Items(i).ToString())
Next
messageLabel.Text = "The displayed files has been uploaded."
Else
messageLabel.Text = "No file path has been specified."
End If
End Sub
Where is the bug in the code above?
I appreciate you usual support.
Thanks.
|
|
|
|
|
The path "~\InputFiles\" & foundFilesList.Items(i).ToString()) would refer to the "application root\InputFiles" on the server. Why would you want to upload from the server to the server??
HTH!
|
|
|
|
|
Thanks Mani,
The path "~\InputFiles\" & foundFilesList.Items(i).ToString() is my server/application path where I want to save the files displayed on the listbox (foundFilesList ). Since the file names have been on the foundFilesList(listbox).
Do you understand what I am trying to do?
|
|
|
|
|
I'm afraid you cannot do it this way. The source file name is a readonly property on the file upload control and can be set only from the client. You cannot set it in server code and try and start the upload from the server.
Only the client browser has to initialize the upload.
|
|
|
|
|
Hi,
I have four textboxes in my web page. I want to apply required field validator such that atleast one of the text box value is required,it is mandatory to have value in any one of the four . how to validate that.
|
|
|
|
|
You can use requiredfiledvalidator property of textboxex.
Your name:
<asp:textbox runat="server" id="TextBox1">
<asp:requiredfieldvalidator runat="server" id="reqName" controltovalidate="TextBox1" errormessage="Please enter your name!">
<asp:button runat="server" id="btnSubmitForm" text="Ok">
Use the Textbox name as per ur project.
|
|
|
|