|
There is no way of preventing a web page being copied. The idea is that the source is easily accessible and trying to prevent the user from doing this won't really do anything, since the nature of the Internet is such that files that can be viewed in a web browser can be accessed by anyone.
Regards,
--Perspx
"A refund for defective software might be nice, except it would bankrupt the entire software industry in the first year." -Andrew Tanenbaum
"Einstein argued that there must be simplified explanations of nature, because God is not capricious or arbitrary. No such faith comforts the software engineer." -Fred Brooks
|
|
|
|
|
The simple answer is You can't.
Todd Smith
|
|
|
|
|
You think you've accomplished one and two. I guarentee you that I can get around it if I wanted to.
I suggest you shouldn't be taking clients if you can't answer their questions.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi,
The following sample will help you out for the points 1 and 4 for sure. Please try this and reply.
<html>
<head>
</head>
<!-- To disable Print Screen feature -->
<body onload=setInterval("window.clipboardData.setData('text','')",2) oncontextmenu="return false" onselectstart="return false">
Test Text
<!-- To disable right click in the web page -->
<script language=JavaScript>
function clickIE() {
if (document.all) {
return false;
}
}
function clickNS(e) {
if (document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS;
}
else{
document.onmouseup=clickNS;
document.oncontextmenu=clickIE;
}
document.oncontextmenu=new Function("return false")
</script>
<!-- To Disable Text Selection -->
<script>
function disableselect(e){
return false
}
function reEnable(){
return true
}
document.onselectstart=new Function ("return false")
if (window.sidebar){
document.onmousedown=disableselect
document.onclick=reEnable
}
</script>
</html>
Thanks,
Rajdev K R
|
|
|
|
|
hi,
I have 2 dropdownlists-one for the selecting country and another for states.When I select a country from the first dropdownlist,the second dropdownlist should show the corresponding states to be selected.I want to do this without postback to the server.How can I do this?Should I use javascript and xml?Please,explain in detail with source code.
Regards,
Bill
|
|
|
|
|
hi dear. give database connections properly. when select the country then all fields in state will be selected. take different tables for states.
thank you
j somasekhar
|
|
|
|
|
You can use Ajax.
Use AjaxControlToolKit[^], where in you can place server side controls in UpdatePanel , and write serverside code.
Thus you can avoid postbacks.
I hope this helps you.
Cheers,
Sudhanva
|
|
|
|
|
store two tables data in some variables when page is loading.
then use javascript to change items in second dropdownlist.
here are steps:
1. store country and state data in two hidden fields, or two variables in JavaScript.
2. write function to change items in second dropdownlist.
...
Changing Select element content on the fly
[^]
Glad to discuss with you and best wishes.
|
|
|
|
|
The page that I am working on displays a set of readonly text boxes with databound values. The user may enter edit mode [achieved through javascript: TxtBox.removeAttribute("readOnly")], modify the value, then exit edit mode [again javascript: TxtBox.setAttribute("readOnly", "true")].
Now when this form is posted back, I want to read the modified value of the text boxes, but all I get is the original values. One possible way for me to do this is put an input type="hidden" corresponding to each texbox being displayed and then, set it's value when the user exits the edit mode of the textbox. This way, when the page is posted back, I can read the value of these hidden fields, instead of actual textboxes. But I don't think this is the right way - unnecessarily increasing the page size, because at times, there could be 100s of textboxes.
Is there another workaround? I am sure this is a common problem - I found many post, but no real solution. Any help is greatly appreciated.
Thanks, R
modified on Saturday, January 24, 2009 4:28 PM
|
|
|
|
|
SmartSpider wrote: Is there another workaround?
No, there is no workaround, there is, however, a way to use the controls correctly. Handle the TextChange event so you will get the updated value.
SmartSpider wrote: there could be 100s of textboxes.
You should rethink your UI design in this case.
only two letters away from being an asset
|
|
|
|
|
Use controls correctly - meaning postback my page on every text change??? Are you serious? And no, I'm not using Ajax... don't wanna go into details of why.
100s textboxes - my bad - that's a typo - 10s textboxes... It's a questionnaire, each question has a prepopulated text box against it.
Thanks anyway
|
|
|
|
|
SmartSpider wrote: Use controls correctly -
You still don't seem to understand this.
Unless the AutoPostback property is true the TextChangeEvent will not fire until a postback is triggered, such clicking a button. Since you seem to not understand the processes involved in ASP.NET I would suggest you take some time to read up on the subject before proceeding with your project.
SmartSpider wrote: And no, I'm not using Ajax
Then you are limiting yourself and reducing the overall user experience, IMO
only two letters away from being an asset
|
|
|
|
|
I am trying to learn C# etc by making this code work, its a mix of examples I've found on the web. The problem is the event handler never triggers. I would also like to change the text of the button that was clicked in the event handler. In a nutshell, I want to create an array of buttons, then change attributes as the text or color of the button selected. Eventually I want to add an array of labels which correstpond to these buttons and change the text or color depending on which button is pushed. Any help is appreciated.
public partial class _Default : System.Web.UI.Page
{
static Button[] btn_arr = new Button[14];
static int btn_count;
protected void Page_Load(object sender, EventArgs e)
{
try
{
if (btn_arr[0] is Button)
{
foreach (Button button in btn_arr)
{
add_button(button);
}
}
else
{
for (int i = 0; i < 14; i++)
{
Button new_button = new Button();
new_button.ID = "btn" + Convert.ToString(i);
new_button.Text = "Button" + Convert.ToString(i);
new_button.Click += new EventHandler(btn_Click);
btn_arr[btn_count++] = new_button;
add_button(new_button);
}
}
}
catch (Exception ex)
{
lblStatus.Text += ex.Message.ToString();
}
}
protected void add_button(Button button)
{
try
{
panelLineA.Controls.Add(button);
}
catch (Exception ex)
{
lblStatus.Text += ex.Message.ToString();
}
}
// this is never triggered
void btn_Click(object sender, EventArgs e)
{
int btnIndex = Convert.ToInt32(((Button)sender).ID.Substring(3, 1));
lblStatus.Text = "Button " + btnIndex + " was pushed." + ((Button)sender).ID;
}
}
|
|
|
|
|
scjsb wrote: The problem is the event handler never triggers.
Check this out.
public partial class Default3 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
ButtonArray();
}
protected void ButtonArray()
{
try
{
for (int i = 0; i < 14; i++)
{
Button new_button = new Button();
new_button.ID = "btn" + Convert.ToString(i);
new_button.Text = "Button" + Convert.ToString(i);
new_button.Click += new EventHandler(new_button_Click);
panelLineA.Controls.Add(new_button);
}
}
catch (Exception ex)
{
lblStatus.Text += ex.Message.ToString();
}
}
void new_button_Click(object sender, EventArgs e)
{
int btnIndex = Convert.ToInt32(((Button)sender).ID.Substring(3, 1));
lblStatus.Text = "Button " + btnIndex + " was pushed." + ((Button)sender).ID;
}
}
Cheers,
Sudhanva
|
|
|
|
|
i have this table TBLImageTest
ID int
Path nvarchar(MAX)
then i upload a image to server (local). image id and path saved to database.
like:
Id = 1,
Path = C:\Documents and Settings\MyUserAccount\My Documents\Visual Studio 2005\WebSites\MyImageTest\UploadedImages\TestImage.jpg
these exact things are saved into database.
then in my allImages.aspx i have this code:
<asp:gridview id="GV1" runat="server" autogeneratecolumns="False" datasourceid="SqlDataSource1" xmlns:asp="#unknown">
<columns>
<asp:templatefield>
<itemtemplate>
<asp:image id="Image1" runat="server" imageurl="<%# Eval("Path") %>" />
</itemtemplate>
</asp:templatefield>
</columns>
</asp:gridview>
<asp:sqldatasource id="SqlDataSource1" runat="server" connectionstring="<%$ ConnectionStrings:MyImageTestConnectionString %>" xmlns:asp="#unknown">
SelectCommand="SELECT [Path] FROM [TBLImageTest]"></asp:sqldatasource>
this doesn't show any image, it doesn't give any error too.
can someone help me with this
|
|
|
|
|
make sure all images can be accessed from IIS.
but not in local.
e.g. you can put images to a directory under IIS root. like <root>\images,
please you can access it like http:\\localhost\images\someimage1.jpg.
if it show normally, then you can display it in anywhere.
please check image path, e.g. c:\images\someimage1.jpg in asp.net webpage
doesnot work.
Glad to discuss with you and best wishes.
|
|
|
|
|
Hi!
I'm trying to do a REALLY REALLY simple math here using ASP.NET...
My code is as follows :
Response.Write(CDbl(25.76) + CDbl(18.0) - CDbl(43.76))
Essentially, it's supposed to print out the answer for 25.76 + 18.0 - 43.76 = 0
Problem is, it keeps giving me - 7.105427357601E-15
What in the world am I missing? It's simple arithmetic is it not?
Hope someone could shed some light on this.
Thank you in advance!
|
|
|
|
|
Hi, just solved the issue... Instead of Cdbl (Double), I simply changed it to a Decimal - CDec...
Thanks anyway!
Ben
|
|
|
|
|
Ben Jern wrote: ASP.NET cannot do simple arithmetic
Just to clear up a misconception you have. ASP.NET is a framework for writing web applications. It never has and never will "do simple arithmetic". The .NET Framework does have a Math class for some complex mathematical functions. Simple arithmetic is built into the language (VB or C# for example).
Ben Jern wrote: Problem is, it keeps giving me - 7.105427357601E-15
What in the world am I missing?
Although you have found an answer by yourself that returns the result that you expected, do you know why? (I'm presuming you've never done a formal course in computer science or software engineering becuase this would have been answered by a 1st year class on floating point maths)
So, what happens is that a Double is represented by 64 bits of memory. Because certaiun numbers cannot accurately be represented rounding errors occur. It is like if I ask you to represent the fraction one-third in decimal digits. The best you can give me is 0.33333333333.... In fact, the series of threes is infinite in this case. If I gave you 64 digits to represent this number, eventually you'd run out of digits to represent the value, yet it still wouldn't actually represent one-third, just a close approximation of it.
In computing terms values that are powers of 2 are represented most easily and other values are less easily represented leading to situations where you end up with a close approximation. Once you start performing mathematical operations on these close approximations you may get some very slight rounding errors creeping in to the results.
The result you got was 0.000000000000000710542935760 which, as you can see, is very close to zero.
The reason you get your answer in decimal is because that datatype is designed for very precise mathematical operations where rounding errors are less acceptable. It does come with some limitations. The processing power required is greater for decimals. The range of values is smaller with decimals. Decimals take more memory to store.
|
|
|
|
|
That certainly clears up a lot of stuff! Thank you very very much...
|
|
|
|
|
HI all,
I have developed a site in ASP.NET 2.0. While accessing my site, if user opens site in two tabs in a browser and starts working simultaneously, then it leads to sharing of session data. I want to restrict user from access site in multiple tabs like most banking sites. Please provide some solution to this problem.
Thanks in advance.
|
|
|
|
|
1. create a session, Session["pagename_time"]=a value, and save the session name in a hidden field.
2. if your access the same page, you should check all session names
start with "pagename_", disable it or remove it before you create a new
session Session["pagename_time"].
3. check the Session exist to know whether user access it from another
page.
hoping this help.
Glad to discuss with you and best wishes.
|
|
|
|
|
i'm working on project creating software using asp.net and ajax , i wanted to include feature giving the user range of color to change color of text or font of text can anybody guide me hw to go about with it or any help pls...
|
|
|
|
|
oh, this is a full solution, pls google it.
Glad to discuss with you and best wishes.
|
|
|
|
|
Guys, what is the difference between Asp.net with Ajax and Ajax alone. Please explain and if there is any links that would be helpfull. Thanks
hawari
|
|
|
|