|
1: Place the controls you want disabling inside a panel and disable the panel.
Cheers,
|
|
|
|
|
Hi,
Disabling the panel might not be a good idea for me as it will grey-out the entire interface and make it harder for the user to read. Further more, there is something else I need to leave it active such as a button.
Any idea other than using panel?
Thanks in advance.
J Liang
|
|
|
|
|
Just don't place the button on the panel...
OR:
Name all your text boxes so they start with "textbox" "txtb" or "tb" etc etc (its a good idea to name controls like this anyway).
<br />
foreach (Control c in myPanel)<br />
{<br />
if(c.ID.StartsWith("textbox"))<br />
{<br />
((TextBox)c).ReadOnly = true;<br />
}<br />
}<br />
|
|
|
|
|
J Liang
1. At the end of your page having HTML ... use some javascipt following way ...
Exaple: getElementsByTagName("input") returns all input HTML control in your rendered page. Now iterate in a loop to set the "disabled" property as you want.
var arr = document.getElementByTagName("input")
for(int i=0;i<arr.length;i++)
{
if(arr[i].type='text')
{
arr[i].disabled = true
}
if(arr[i].type='button')
{
arr[i].disabled = true
}
//like this
}
2. Is there any explicit reason that you are opening a new window from the server side.Generally there is no reason to open a window from server side
Thanks,
Arindam D Tewary
|
|
|
|
|
Hi,
1. I could not use javascript, unless from asp.net, it can use that piece of javascript you posted here as the javascript only allowed to run if some of the criterias are meet where the checking is done using asp.net.
2. The reason I set the link to open a new window as server side control is because I need to hide it and only make it available when some criterias are met. Again, the checking is done from asp.net.
Any idea which I can solely do all these things using asp.net?
Thanks in advance
J Liang
|
|
|
|
|
I've had a quick search of the forums but no posts seem to cover my question.
Unlike the other posts on dynamic controls: my controls render fine, they respond to events that I've wired them up to....
It's just I'm looking for a technique that is more dynamic and elegant for wiring the events up.
For example:
I have one page that dynamically changes it's contents depending on the url used to navigate to it (An HttpHandlerFactory helps do this for me) So the content generator on PageContent.aspx could be pointed at, say, 20 different XML sources and thus render 20 totally different pages...
the problem with my current method is that it requires all the events for those 2 pages to be defined and wired up in one place.... Which makes the page code behind very cluttered with all the possible events.
Is there any way to do this in a more elegant fashion?
say, for example:
* Store all the events for one possible page layout in another file??
* Access a class containing all the possible events via dynamic Javascript on the page that makes calls that are handled by an HttpHandler??
* Or any other way?
Cheers,
|
|
|
|
|
Hello,
I use user.identity.name to display the current user in my webpage. My page also has a send email notification button to the intended recipient together with the URL link where he/she can locate the page.The recepient will receive the email and open the URL to the webpage. Then it will direct the recipient to log in page to log his/her ID for authentication.My problem is, the label that display user.identity.name still diplay the last username. I need to show the current user of the page. Pls advise and show me the proper code for this. I am using asp.net vb code.
Thanks in advance.
|
|
|
|
|
will you please paste the code where you change the label text
|
|
|
|
|
goo morning every body
how to use scrolling in grid view
help me
Piyush Vardhan Singh
Programmer
TAS NewDelhi
India
|
|
|
|
|
place your grid in panel and set panels proper Panel1.ScrollBars=ScrollBars.Vertical
may be it's helpfull 4 you
Basharat
|
|
|
|
|
thanks
Piyush Vardhan Singh
Programmer
TAS NewDelhi
India
|
|
|
|
|
hello is there any help plz guys i got "Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index " error
Public Sub RadChart1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadChart1.Load
Dim sqls As String = "select CallType, count(CallType) from RecCalls where CallType = 0 Group by (CallType)"
Dim cmd As New SqlCommand
cmd.CommandText = sqls
Dim strcon As New SqlConnection(Conn)
Dim CallsAdapter As New SqlDataAdapter
CallsAdapter.SelectCommand = cmd
cmd.Connection = strcon
strcon.Open()
' RadChart1.Series.Item(0).Item(0).Name = "In " + sqls
Dim result As Integer
'for loop for all items i =0 -4
Dim strType As String
Dim i As Integer
For i = 0 To 3 + 1
Select Case (RadChart1.Series.Item(0).Item(i).Name)
Case "in"
strType = 0
Case "out "
strType = 1
Case "Missed"
strType = 2
Case "RAdio"
strType = 3
End Select
Next i
sqls = "select CallType, count(CallType) from RecCalls where CallType = " & strType & " Group by (CallType)"
result = cmd.ExecuteScalar()
RadChart1.Series.Item(0).Item(i).Name() = RadChart1.Series.Item(0).Item(i).Name() + " " + result
End Sub
thank in advance
Developer
|
|
|
|
|
devsam wrote: 3 + 1
Why not 4 ? Why do you hard code this, this is almost certainly your problem.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
ok.. can u help me i make it 4 but the same eroor i got and how i hard the code would give me anothere way to see what do u mean and i am still new
Developer
|
|
|
|
|
You've obviously very new, and hopelessly lost. Replacing 3+1 with 4 makes your code more legible, but it's still going to do the same thing - 3+1 = 4. You should instead write code that works out how many items it's going to iterate over, or at least checks if the number you expect is there.
You should also try to give your variables real names, 'radchart1' doesn't cut it. That's another hint on readability.
Given that you're using controls that have to be bought, I assume you're not in a class, so I think you should go and ask your employer to provide you with a book on ASP.NET and one on the language you're using, so you can work through them, and start to understand the nature of what it is you're trying to do.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
ok mr. Graus
i worte this code and if i got an error dos'nt mean that i don't nderstand what i wrote
i just coud'nt fix the error ..i know that i need to learn and read more that whay i sent my question here
Developer
|
|
|
|
|
Try the following ...
Replace ....
For i = 0 To 3 + 1
by
For i = 0 To 3
Thanks,
Arindam D Tewary
|
|
|
|
|
its not work..
and thanks for trying to help me
Developer
|
|
|
|
|
The error description says the error is in that line. Try giving upper limit of loop control variable i as RadChart1.Series.Items.Count or RadChart1.Series.Items.length which one is relevant.
Thanks,
Arindam D Tewary
|
|
|
|
|
hii .. i fix it
RadChart1.Series.Item(0).Item(i - 1).Name() = RadChart1.Series.Item(0).Item(i - 1).Name() + " " + result.ToString
but its return the last case value
Developer
|
|
|
|
|
Hi all,
Iam generating a gridview which is wider than A4 page. I need to be able to print by default landscape. Is that possible? Thanks
|
|
|
|
|
hi all,
i wnant to format the datetime in gridview control .we are binding data to label using temlate column i want to format the date time to mm/dd/yyy hh:mm Am or Pm pls help me i am new to asp.net2.0
Thanks,
Guru
|
|
|
|
|
try this
<%# Eval("fieldName","mm/dd/yy h:mm: tt")%>
Best Regard
Pathan
GOD HELP THOSE WHO HELP THEMSELVES
|
|
|
|
|
Hi, every body..
i want to create an xml file dynamically in the wwwroot, but the wwwroot is shared. its showing the exception "Unauthorizedaccessexception". i checked it with unshared folders. its working fine.. how can i solve this...
Thks..
Sam Joseph,
Web Developer
|
|
|
|
|
Check ASP.NET account is having write permission on the above folder.
|
|
|
|