|
Is this conversation cover me from cross-site scripting? (Especially in asp.net post forum pages)
< to & lt;
> to & gt;
& to & amp;
|
|
|
|
|
From the few keywords in your "question", this belongs in the ASP.NET forum. Though I have no idea what you're saying because your "question" doesn't make any sense.
|
|
|
|
|
Acutually I want to prevent cross-site scripting in asp.net forums.
If I want to protect from user input data when user (lamer) enter script in the textbox in asp.net forms.
If I get to textbox string and convert the <, >, & symbol to HTMLEncoding in the string.
Is this process enough for prevent cross-site scripting?
|
|
|
|
|
Go test somewheres else instead of in a forum
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
hello sir,
i have got a serious problem plz help me
my problem is that i have to show report of employees
in mail merge format using crystal report 9
plz give me some idea
|
|
|
|
|
Please do not use textspeak, for it is annoying to many people around here. Please be more specific about your problem you are having.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hello,
Task is to add Thumbnail Images to a listbox control. Search on codeproject/Google showed me ImageListBox/ImageList controls. I tried these and eventually felt lost.
Can anyone give me a guidance on where to start? or any points to note.
Thanks
D
|
|
|
|
|
Hi,
this is what a ListBox shows:
- strings, if that is what you add to its Items collection
- ToString() results of whatever type you add to Items
- whatever you want if you do the painting yourself.
So you must go for "owner drawn" and use the relevant events.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Hello Luc,
Thanks for your response. I am afraid i didnt quite understand what you meant.
Could you please elaborate or point me to any other link?
Thanks
D
|
|
|
|
|
These are the keywords you need (for either ListBox or ComboBox):
DrawMode, DrawItem, and maybe: MeasureItem
I suggest you read up on them.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
|
Hello,
My task is to open an Image Properties page programmatically. Properties page as you get by right clicking on the image and selecting Properties on Context Menu.
I know rundll32.exe can open up printer properties, Is there a similar way or any another?
Thanks
D
|
|
|
|
|
I don't believe there is a simple way of doing it. But you should be able to adapt this[^] to invoke the properties window yourself.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
Thanks much! I will give it a try!
D
|
|
|
|
|
I was testing BackgroundWorker and ran into this problem.
<br />
BackgroundWorker bw = new BackgroundWorker();<br />
<br />
bw.DoWork += new DoWorkEventHandler(bw_DoWork);<br />
bw.RunWorkerAsync();<br />
<br />
void bw_DoWork(object sender, DoWorkEventArgs e)<br />
{<br />
Form3 f = new Form3();
f.Show();<br />
}<br />
The Form f, is unresponsive. How can this problem be solved?
Using this code though, the form runs fine.
<br />
void bw_DoWork(object sender, DoWorkEventArgs e)<br />
{<br />
Application.Run(new Form3()); <br />
}<br />
Thanks.
The next great innovation - A built-in coffee maker in your computer table.
|
|
|
|
|
void bw_DoWork(object sender, DoWorkEventArgs e)
{
Form3 = new Form3();
f.Show();
Application.Run(); //Begins running a standard application
//message loop on the current thread, without a form.
}
This explains, why the form was unresponsive. The messages were not handled at all. With a Message loop, the form works fine.
Any more ideas ?? Maybe there's a better way to do this??
Thanks.
|
|
|
|
|
It won't work because the form is cut off from the application message pump by the thread boundry. In order for the form to work, it has to be on the same thread as the message pump. The message pump is created by the Application.Run() method. It's NOT a good idea to run multiple pumps inside the same app to get around that limitation. UI elements should stay on the main thread.
|
|
|
|
|
Hi Dave, thanks for the info.
So, the appropriate thing to do would be do would be:
- do all the main processing in DoWork function
- Send the required information to displayed by UI via. ProgressChanged or RunWorkerCompleted; unlike what i did by creating a Form or any other control inside the thread
- The UI controls stay in the main thread in this way.
Thanks.
Laex
|
|
|
|
|
How can we implement the Reflection concept in C# Application?
---
Regards
ilango gandhi
|
|
|
|
|
By writing C# code that utilizes the classes in the System.Reflection namespace.
Paul Marfleet
|
|
|
|
|
Hi,
Here you have some Reflection Samples
Visit my blog at http://dotnetforeveryone.blogspot.com
|
|
|
|
|
I did this in VB and would like to do this in C# now.
UserForm1.Controls("chkbx_ManProp_" & CStr(j)).Value = True
any ideas how to convert this to C# in a windows form application?
Thanks
|
|
|
|
|
Crazy VB code, so you want to access the property of a control on another form?
If so, add a method to the forms class that will modify the control. Then you can call the method.
My current favourite word is: Waffle
Cheese is still good though.
|
|
|
|
|
I wrote the VB app in a short amount of time, so that snippet was pretty much done on the fly ;o
the property of the control(s) that I want to access is within the same form.
Unfortunately, there isn't a direct correlation of VB and C# methods so I'm not sure where to look.
I was thinking about something like this:
start a loop
Application.getControlbyName("object_name_as_string" & integer_variable).value = false
integer_variable++;
end loop
in essance what this should do is programmatically loop through all the controls with similar naming conventions, and set its member value to false.
Any suggestions / alternate ideas on how to accomplish this in c#???
Thanks in advance
Humble.
|
|
|
|
|
ControlName.PropertyName = NewValue;
Not sure why you want to loop through the control list when the above template should work within the same form.
Of course, you could do the looping but it takes a bit more skill and would look something like the code below. I would stick with The Undefeated's advice.
public static Control FindControl(Control root, string nameToFind)
{
Control retval = null;
foreach (Control c in root.Controls)
{
if (c.Name == NameToFind)
{
retval = c;
break;
}
retval = FindControl(c, nameToFind);
if (retval != null)
{
break;
}
}
return retval;
}
|
|
|
|