|
How can I write the following peusdo code:
I'm filling a content place holder with a certain amount of controls
After the content place holder has been filled I need to , after 3 controls, to make the rest invisible, how would I go about that?
thanks
The answers posted by me are suggestions only and cannot be used in anyway against me.
|
|
|
|
|
I think you have to hide it from Page ?
Is that right ?
You must have given some Id to your content Placeholder
Create public properties in the masterPage to hide this content placeholders and call these properties from your page
Is that you want ?
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
Check My Blog
|
|
|
|
|
Sandeep Akhare wrote: Is that you want ?
No
Basically I have ten controls in the place holder but I only want 3 of them to show on the page. Therefore I need to make the first 3 visible and the rest invisible.
How would I do that?
The answers posted by me are suggestions only and cannot be used in anyway against me.
|
|
|
|
|
in pseudo code:
set count equal zero
while there are controls to add
create control
if count is greater than 2 set control visibility to invisible
add control to placeholder
increment count
really not hard. what's your issue?
|
|
|
|
|
OK, well so far I have the following:
foreach (string srg in fields)
{
Label lb = new Label();
}
fields is an array list.
So once its gone through the array list it wont add any more controls.
So how would I change that to a While loop?
Would I count the srg in fields instead until there is none?
J4amieC wrote: really not hard. what's your issue?
Nothings hard when you know the answer...
thanks for the reply
The answers posted by me are suggestions only and cannot be used in anyway against me.
|
|
|
|
|
how about:
for(int i=0;i<fields.count;i++)>
{
Label lb = new Label()
lb.Visible = (i<3);
}
|
|
|
|
|
Your question is confusing
Are you using Master Page in your page ?
If no there are 10 controls directly in the Page
then there are many way to do it
1. Access the control using its Id make its Visible propety false (n times)
2. Put all other control in one placeholder or div (run at server)
and hide this placeholder/dev by making Visible =false;
Is that you want ?
Please describe your question little more if it is still not resolved
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
Check My Blog
|
|
|
|
|
Im trying to create a new web user control, and im using the steps below from MSDN help, my problem is on step three. i cant find the Web control Libary using this process, but when i go to an existing page and add item, Web COntrol Library appears but i wont be able to create the dll for the from within another application.
Does anyone know what im doing wrong.
To create the custom control
1.On the File menu, point to New, and then click Project.
The New Project dialog box appears.
2.In the Project Types pane, choose either Visual Basic Projects or Visual C# Projects.
3. Select Web Control Library in the Templates pane.
Change the Name to CustomLabel and click OK.
The new project is created, and WebCustomControl1 opens in the Code Editor.
4.Code for a custom Label control is included in the Web Control Library template by default. This is the control you will use in this walkthrough.
On the Build menu, click Build CustomLabel to compile the control.
The control is compiled as CustomLabel.dll. By default, it is created in the Bin folder inside the CustomLabel project folder.
Save the file.
|
|
|
|
|
Not an issue if you don't have Web Control Library in the Templates then
Select Class library and go ahead create your custom control
Make Sure that You will have to add System.Web dll by adding Reference to this project
you don't have Web Control Library because may be you have different VS edition
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
Check My Blog
|
|
|
|
|
Thank you very much
I have installed a service pack and it now appears, but i cant see the design view anymore. Would you know whats causing this.
|
|
|
|
|
Yes you can't see the design view whenever you are rendering the control at run time. It will show you error because at design time what is present in the control if you re rendering it at run time do design time IDE don't have any information about UI controls to display
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
Check My Blog
|
|
|
|
|
Thank you.
No its not even at run time, once i finish clicking the Web Control Library Template, i just get c# code and cant get to design view window.
Do you have links that can led to steps on how to do this, i might be missing something.
|
|
|
|
|
I think you are creating Custom control
For custom control there is no Design view
You are resposible for rendering,State,... implementing all these functionality
Please have a small search in google
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
Check My Blog
|
|
|
|
|
Thank you very much for your help,
You are right i m using custom controls.
Let me see what i can do.
|
|
|
|
|
Hi,
I am using sql server 2005 and ASP .Net 2.0, VS 2005.
When I increased a parameter in Stored Procedure and in application, and again running the application it throws an error that, Parameters does not match with the stored procedure parameters.
All i have to do is restart the machine and again run the application. Then it does not throw the error and it works fine with the extra parameter in application as well as in storedproc.
I am unable to understand what is the exact problem, that i have to restart the machine and then it accepts the changes
Sandeep Kumbhar
|
|
|
|
|
What machine are you restarting?
The user's
the web server
sql server
After the restart has the SP changed at all?
The answers posted by me are suggestions only and cannot be used in anyway against me.
|
|
|
|
|
i am restarting the machine on which i am developing the application.
when the changed the parameters in application as well as stored procedures and running the application it gives me error that parameter does not match. after the restart the machine it works fine with the changed parameters
Sandeep Kumbhar
modified on Friday, September 19, 2008 1:25 AM
|
|
|
|
|
i have writing code detection(insertion and remove) of card reader.its work properly and it detect usb and card reader both drive.
There any property to detect it Usb or Card reader?
Please Help Me//
thanks
CODE:=
Private WithEvents m_MediaConnectWatcher As ManagementEventWatcher
Public USBDriveLetter As String
Dim StrStatus As String
Public USBDriveName As String
Dim _ReaderSetting As Settings
Public Sub StartDetection()
Try
' __InstanceOperationEvent will trap both Creation and Deletion of class instances
Dim query2 As New WqlEventQuery("SELECT * FROM __InstanceOperationEvent WITHIN 1 WHERE TargetInstance ISA 'Win32_DiskDrive'")
m_MediaConnectWatcher = New ManagementEventWatcher
m_MediaConnectWatcher.Query = query2
m_MediaConnectWatcher.Start()
Catch ex As Exception
End Try
End Sub
///////
Private Sub m_MediaConnectWatcher_EventArrived(ByVal sender As Object, ByVal e As System.Management.EventArrivedEventArgs) Handles m_MediaConnectWatcher.EventArrived
Try
Dim mbo, obj As ManagementBaseObject
' the first thing we have to do is figure out if this is a creation or deletion event
mbo = CType(e.NewEvent, ManagementBaseObject)
' next we need a copy of the instance that was either created or deleted
obj = CType(mbo("TargetInstance"), ManagementBaseObject)
Select Case mbo.ClassPath.ClassName
Case "__InstanceCreationEvent"
If obj("InterfaceType") = "USB" Then
StrStatus = StrStatus + obj("Caption") & " (Drive letter " & GetDriveLetterFromDisk(obj("Name")) & ") has been plugged in" + vbCrLf
Else
StrStatus = StrStatus + obj("InterfaceType") + vbCrLf
End If
Case "__InstanceDeletionEvent"
If obj("InterfaceType") = "USB" Then
StrStatus = StrStatus + obj("Caption") & " has been unplugged" + vbCrLf
If obj("Caption") = USBDriveName Then
USBDriveLetter = ""
USBDriveName = ""
End If
Else
StrStatus = StrStatus + obj("InterfaceType") + vbCrLf
End If '__InstanceModificationEvent
Case "__InstanceModificationEvent"
Dim Str As String = GetDriveLetterFromDisk(obj("Name"))
If obj("InterfaceType") = "USB" And Not Str = "" Then
StrStatus = StrStatus + obj("Caption") & " (Drive letter " & Str & ") has been plugged in" + vbCrLf
Else
StrStatus = StrStatus + obj("Caption") & " has been unplugged" + vbCrLf
End If
Case Else
MsgBox("nope: " & obj("Caption"))
End Select
MsgBox(StrStatus)
Catch ex As Exception
End Try
End Sub
Private Function GetDriveLetterFromDisk(ByVal Name As String) As String
Try
Dim oq_part, oq_disk As ObjectQuery
Dim mos_part, mos_disk As ManagementObjectSearcher
Dim obj_part, obj_disk As ManagementObject
Dim ans As String = ""
' WMI queries use the "\" as an escape charcter
Name = Replace(Name, "\", "\\")
' First we map the Win32_DiskDrive instance with the association called
' Win32_DiskDriveToDiskPartition. Then we map the Win23_DiskPartion
' instance with the assocation called Win32_LogicalDiskToPartition
oq_part = New ObjectQuery("ASSOCIATORS OF {Win32_DiskDrive.DeviceID=""" & Name & """} WHERE AssocClass = Win32_DiskDriveToDiskPartition")
mos_part = New ManagementObjectSearcher(oq_part)
For Each obj_part In mos_part.Get()
oq_disk = New ObjectQuery("ASSOCIATORS OF {Win32_DiskPartition.DeviceID=""" & obj_part("DeviceID") & """} WHERE AssocClass = Win32_LogicalDiskToPartition")
mos_disk = New ManagementObjectSearcher(oq_disk)
For Each obj_disk In mos_disk.Get()
ans &= obj_disk("Name") & ","
Next
Next
Return ans.Trim(","c)
Catch ex As Exception
Return Nothing
End Try
End Function
Piyush Vardhan Singh
p_vardhan14@rediffmail.com
http://holyschoolofvaranasi.blogspot.com
http://holytravelsofvaranasi.blogspot.com
|
|
|
|
|
Hi friends,
Can anyone help me in developing application with multiple language support.
we can make use of resource files but
whether to use gloabal resource or local resource pls suggest me.
My application is having 15 pages , and m using master pages.
And i want to know how to use java script with multiple languages.
Any help can be appreciated.
regards,
|
|
|
|
|
hi,
use global resource file.(extension .resx).there u have name and value.in the name give the name of ur control and in value the language by which u r calling that control.for.eg u have empname as name give some value for that like Employeename and call it in codebehind like
txtempName.text=Resources.<resourcefilename>.empname
T.Balaji
|
|
|
|
|
Thanks balaji,
m using global resource file as u said, but
how abt java script , i hav written some java script functions how to make them dynamic depending on language.
thanks inadvance.
|
|
|
|
|
cd is ezr 2 rite if u fix ths mssng kys on ur kybrd
|
|
|
|
|
That made me laugh out loud
The answers posted by me are suggestions only and cannot be used in anyway against me.
|
|
|
|
|
That took me a minute to translate. I ran it through Babelfish, but there's no option for "Txt spking idiot to English" in there (and I'm not calling you an idiot here ).
modified on Thursday, September 18, 2008 7:14 AM
|
|
|
|
|
It still surprises me how easy English is to read if you drop most/all vowels. maybe these 1d10t txtspkrs have a point
|
|
|
|