|
Guys,
is it possible to use both ClientOnCLick and OnClick on a button?
ClientOnClick will call a javascript function to validate, and if it returns true, then the Onclick delegate should be fired!
thanks
Estarta
|
|
|
|
|
Yes, that's exactly how it works, I believe.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
thanks for the reply,
just one thought, the server side delegate will never be fired if the validation part 'Client side validation' was false is that true?
Estarta
|
|
|
|
|
Correct, because postback will not occur.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hello,
I have a class with a property that allows the getting and setting of a field. However, once that field has been set, I don't want it to be set again. Is it reasonable to have a get/set property that only allows the property to be set once? Am I trampling on some best practice here or am I completely OK?
(In my particular case, it won't work to have the field set by the constructor.)
Thanks!
|
|
|
|
|
If you are making this available for use elsewhere then it's not good practice to have a single set field. Part of the problem you are going to have is that your field can be got to and set via reflection, so any single-set updates can be bypassed.
|
|
|
|
|
Thanks for your thoughts.
|
|
|
|
|
Pete O'Hanlon wrote: your field can be got to and set via reflection
Ummm... what? My privates aren't private?
|
|
|
|
|
PIEBALDconsult wrote: Ummm... what? My privates aren't private?
Exactly. Using reflection there's not much that can't be done.
Accessing otherwise not accessible members via reflection is one of the easier tasks.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
PIEBALDconsult wrote: My privates aren't private
Ignoring the innuendo that arises here, the answer is no. Reflection allows you to get right at the heart of your code if you know what you are looking for.
|
|
|
|
|
I was going to suggest using a read-only variable, but then i read about not being able to use the constructor.
Instead, try setting up a private (or protected) variable for whatever it is you want (which you already have), then just use a regular method to set it, but check that it is null, or whatever its default value is first, like this:
private string name;
public void setName(string Name)
{
if(name != null)
name = Name;
else
}
You could just do the same thing using a set method (and then being able to just use Y = X; ) but it just doesn't seem to be the type of place to put it. Plus, you could have your regular method return a bool so that you know if you have set the variable or not.
My current favourite word is: Bauble!
-SK Genius
|
|
|
|
|
Thanks for your reply. I'll ponder this some more.
|
|
|
|
|
Unfortunately, this design (while being good) doesn't address the fact that the private member could still be set directly. The poster needs to think some more about his design before he tries this.
|
|
|
|
|
Can I have a abstract function to implement a interface?
For example
namespace Project1
{
public interface ITest
{
String ControlTitle { get; }
}
}
namespace Project1
{
public abstract class Test : ITest
{
public abstract String ControlTitle();
}
}
|
|
|
|
|
Not the above code, you changed the property defined in ITest to a method.
Otherwise yes.
One question though, why not just try it?
I'm largely language agnostic
After a while they all bug me
|
|
|
|
|
did you try it? what happened?
A little self help wouldn't go amiss!
|
|
|
|
|
I tried it before posting here. It was the error of having it as a method rather then a property that was holding me back.
|
|
|
|
|
how can i build a view of the object while i am editing it. Like in Ms power point. I am not sure where to start and look from any suggestion, please.
|
|
|
|
|
netJP12L wrote: I am not sure where to start
We're even, because I don't know what your asking for.
only two letters away from being an asset
|
|
|
|
|
Sorry if I didn't explain clearly. I have 2 panel on my Left side panel I couple of objects which which i move then around and on the right side I want to display the view of the left side panel. If I move any of the objects on the left side the changes should effects right away and should be shown on the right side panel.
|
|
|
|
|
The way to do this is to use a design pattern (or two). I'm thinking here specifically of the Model View Controller pattern. Read up on this as it's going to be your best friend here. As a taster though, I will tell you that the MVC pattern allows you to have one model with multiple views of the same model so you will update the model and the views will be updated to match. I'm sorry, but I can't give you the code for this because it is a fairly complex design architecture that you need to get to grips with and it's more code thank I could give you in such a short space.
|
|
|
|
|
Hello.
I have developed a simple communication system as a website where my site users can send messages to each other after logging in. I store the messages in SQL Server. I store the subject, body and other common properties of a message. What I need now is to make my web application POP3- and SMTP-enabled. So that I not only store my messages in my database, i prove my users with email addresses on my website like user1@mydomain.com, so that incoming emails to this address, will be intercepted and I can show each user his messages. Also they can send messages, not only to the internal users of my system, but everybody who owns an email. I think I should let my application talk in POP3 and SMTP language.
On the net, I found some useful articles. One described how to use socket programming to save the message on the server side in a folder. But the problem is that who is gonna send it at the end? IIS? But what if I myself want to send it? What should I do to send a queued message to the recipient's address?
Please if anybody has any experience in this field, help me out.
Thanks in advance.
|
|
|
|
|
Hi Hamid,
what you want to implement is called a 'mailserver'.
There are 2 possibilities to realize that :
1. If you want to reinvent the wheel : You can write your own server, but you should be aware, that
this is NOT trivial. There will be at least 2 protocols you have to implement (SMTP & POP3) in
addition to all the internal handling. If you plan to do something like that, I would recommend
to have a look at the RFC's first so that you have an idea what that means.
A collection of RFC's can be found here :
http://www.rfc-editor.org/rfc-index2.html
2. You can use an existing product. There are several commercial and non-commercial systems available.
Here are just a few links, to some existing solutions :
Lumisoft Mail Server
mail Enable
Hope, that helps a bit ...
Sven
|
|
|
|
|
Check out the System.Net.Mail[^] namespace. It has a bunch of good stuff that might help you with your problem.
|
|
|
|
|
I have an MS Access DB and a desktop application which I want it to check for the new items on the database and print. right now i am able to check the database and see the new items, but I dont know how to refresh it on the desktop app.
I want to check the db ( lets say) every 2 mins for new items on the list.
private void TheJob()
{
DataAccess da = new DataAccess();
string sql = "SELECT COUNT(*) FROM read WHERE [New?]=true";
string tmpValue=da.GetValue(sql);
NotifierInfo.Info = "You have " + tmpValue + " clients waiting";
NotifierInfo.ShowInfo();
How can i check the database every 2 mins for new items ? Thanks
|
|
|
|