|
hai2muru wrote: Pls......................
The title makes no sense, see Chris's tips[^]
Google[^] may quickly answer for this sort of questions.
|
|
|
|
|
Using VS 2003 is there any way to create a conditional web.config?
As that question is a little vague let me explain. In my project I use the web.config file to define various authorisation levels for specific areas of the project. For development purposes, under debug builds this config is not as restrictive as the release build.
At the moment, when we created a release build we have to manually alter the web.config file to release settings. On occasion, unfortunately some permissions have been missed or this manual process has faild somewhere.
So is there a way to create code style conditional statement in the web.config?
As an example:
#if DEBUG
<location path="MyPages/page1.aspx">
<system.web>
<authorization>
<allow users ="*" />
</authorization>
</system.web>
</location>
#else
<location path="MyPages/page1.aspx">
<system.web>
<authorization>
<deny users ="*" />
</authorization>
</system.web>
</location>
#endif
If this isnt possible is there any way of having two web.config files, one for release builds the other for debug builds? I suppose this could be done via some clever post build event scripts, however if there is an "official" method I would prefer to use that instead.
|
|
|
|
|
I am interested in knowing the answer to your question. The way I do it now is I have a dev web.config and a release web.config. I "publish" to a staging server then manually copy the files to the production server when it is ready. So it is easy enough for me to copy everything except web.config because it rarely changes at this point.
|
|
|
|
|
In the VS 2005, you may use the Web Deployment project, but AFAIK there's not any "official" way in VS 2003. That said, you may rely on the post build events like you said to that.
|
|
|
|
|
Hello,
I created a simple class as follows:
Public Class HelloWorld
Public Function SayMessage() As String
Return "Hello World!"
End Function
End Class
Usage:
Dim objHelloWorld As New HelloWorld()
MyLabel.Text = objHelloWorld.SayMessage()
Then I recreated the class using a property:
Public Class HelloWorld
Public ReadOnly Property Message() As String
Get
Return SayMessage()
End Get
End Property
Public Function SayMessage() As String
Return "Hello World!"
End Function
End Class
Usage:
Dim objHelloWorld As New HelloWorld()
MyLabel.Text = objHelloWorld.Message
Which appoach should I use or when to use which one?
Could you advice me on this?
Thanks,
Miguel
|
|
|
|
|
My question has a reason.
I have a class with a function named Get_OneRecord.
The function Get_OneRecord gets ONLY ONE record from a database using a Data Reader.
The record has 4 fields. So this function returns a string collection with the four fields.
Should I use 4 properties as follows:
Public ReadOnly Property Name() As String
Get
Return Get_OneRecord{1}
End Get
End Property
Public ReadOnly Property Address() As String
Get
Return Get_OneRecord{2}
End Get
End Property
Which will return the first field of the collection or array: MyLabel.Text = MyClass.Name ...
Or should I use the function and access each string collection item outside: MyLabel.Text = Get_OneRecord{1}
Do you understand my problem?
Thanks,
Miguel
|
|
|
|
|
Use properties, as they give a name to the values. "Name" is much more descriptive than "1".
Don't read the record from the database each time you use a property, though. Read the record the first time it's needed, and store the data in a private variable in the class.
Class
Private Data() as String
Public ReadOnly Property Name() As String
Get
If Data is Nothing Then Data = Get_OneRecord()
Return Data(0)
End Get
End Property
...
Private Sub Get_OneRecord() as String()
...
End Sub
End Class
---
b { font-weight: normal; }
|
|
|
|
|
Generally properties are used to get and set values, and methods are used when you perform some work.
As you are just getting a simple value, it would be logical to use a property.
If you did some more complicated work to get the value, like reading it from a file, it would be more logical to use a method.
In some cases properties can do a bit more work, but then there is a difference in how you expect properties and methods to handle the data. A property can for example read a value from file and keep the value in a private variable, so that it doesn't have to read the file if you read from the property again. If you have a method on the other hand, you would rather expect it to actually read the value from file each time you use it.
---
b { font-weight: normal; }
|
|
|
|
|
|
check this
http://www.codeproject.com/aspnet/PicManager.asp?df=100&forumid=156404&exp=0&select=1465072
|
|
|
|
|
Hi all! Pls help me with using spell checking capabilities of Ms-Word in asp.net.
Thanks.
|
|
|
|
|
Hi Friends,
I am filling treeview from sqlserver table, its working and I am happy.
But My problem is
I want to use SiteMapPath tool with that treeview but I dont know how? I tried to search over internet but couldn't find any good stuff.
I am not sure if i can use SiteMapPath tool in the above stated secnario. If I can use then please help or if you know any other method to provide SiteMapPath functionality, It would be a great help.
thanks in advance.
Naveed Kamboh
|
|
|
|
|
Hi,
You can use the the tree view's NavigateUrl property to navigate to different links. However, i gues for site map path we need to use the web.Sitemap file and add all the nodes.
|
|
|
|
|
Hello.
If i have some user errors I want to return to the client, what is best way to do it?
Example:
I have a WS:
[WebMethod]
public boolean addUser(struct userDetails)
In this registration I validate that the:
-phonenumber is in a valid format
-email is in a valid format
If these two validations fail I want to return the error message to the user.
What is the smoothest way to perform this ?
Regards,
Markus Foss, Oslo, Norway
|
|
|
|
|
Hi Folks! I have a button clicking on which some processing is done, what I want to do is show a message "Processing" until results are displayed. Similarly when Google page is loading it shows "Loading".i.e How to show loading message when page is loading. How to achieve this.Any idea?
Thanks
|
|
|
|
|
you have to use ajax/atlas for that.
|
|
|
|
|
Pls guide me to a good Ajax/Atlas tutorial from where I can start.
Thanks.
|
|
|
|
|
HI
i have an image stored with only solid colors
i want to know color percentage of each color in the image
can u help me how to do it
piyush
|
|
|
|
|
|
Hi ...
- Import the System.Drawing.Bitmap
- Declare a new bitmap image: Dim pic As New Bitmap(filename)
- Now use the pic.getpixel(x,y) method to get the A,R,G,B numbers in the image ... x & y r the coordinates
for i = 0 to pic.width - 1
for j = 0 to pic.height - 2
c = pic.getpixel(x,y) 'c is a color
next
next
- You can declare and array of colors and increment its index for color repitition in the loop the divide the total color occurances by the total colors in the image
Hope It's useful ... And if u need anything else in this field don't hesitate to ask me
Best Regards
3ala2
|
|
|
|
|
Dear all,
Pls tell me how to retrive OLE Object from msaccess.
|
|
|
|
|
I have my project uploaded on an open ip. my project uses ajax and added reference in web.config. there is also other project in .net. these projects take my web. config as their web.config. and throws error that ajax.dll not found. i have to remove this http handler from web.config. but my ajax works.
plz help me to find the solution.
Thanks For ur help
|
|
|
|
|
Hi,
I am using the following code in codebehind file for creating a saveAs dialog box in webApplication in VB.net.
Dim filename As String = Session("DateTimeStampZip")
Dim fullPath As String = Server.MapPath(ConfigurationSettings.AppSettings("ServerDownload")) & "\" & filename
Dim dataStream As FileStream = New FileStream(fullPath,System.IO.FileMode.Open)
Dim fileLength As Integer = System.Convert.ToInt32(dataStream.Length)
dataStream.Close()
dataStream = Nothing
Response.Clear()
Response.ContentType = "application/octet-stream"
Response.AppendHeader("Content-Disposition", "attachment; filename=" & filename)
Response.AppendHeader("Content-length", fileLength.ToString())
Response.WriteFile(fullPath)
Response.End
My problem is that when I run the above code, I am getting a saveAs DialogBox with (checkbox:Always ask before opening this type of file.) shown in disabled mode..
With disabled I mean, in non-editable mode i.e; I am not able to check or uncheck the box.
When i click on open button in the box, same box pops up second time with the checkbox in enabled mode. Now i am able to open the file.
I want this saveAs dialogBox with the checkbox in enabled mode when I run the code first time and not after I click on open button in the dialog box.
Can anyone workout a solution to my problem..
PLease its urgent...
or any other way to create the dialog box using code in c# or vb.net...
Vikram Mera
|
|
|
|
|
Hello,
I am starting a new Asp.Net 2.0 web site.I am looking for a fixed width web site.
I notice that CNN is using a 875px fixed width web site and Yahoo a 950px width web site. And many other web sites are using widths higher then 800px.
My question is:
What do you think of moving to widths higher then the 750px...780px usually used taking the 800px screens in consideration.
Thanks,
Miguel
|
|
|
|
|
That depends on your design. You can have a web page that wills the whole screen and looks good on any resolution (relative width's).
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|