|
i wud lik to take data read from a bar-code reader into my application and do the invetory manipulations , plz help
- Thanx in Advance.
|
|
|
|
|
Hi,
most barcode readers work by using keyboard emulation. If you press the button on your barcode scanner, the scanner will read the bar code and simulates a user input using the keyboard. You could place a texbox on your page, setting the focus on this texbox. Then the user uses the barcode scanner. This will put the barcode into the textbox. If the user presses a button, the input will be submitted to the application and you can handle it. (Or send the form automatically 2 seconds after the first input (done with js), this will avoid that the user has to press a button).
Does this help you?
Regards
Sebastian
|
|
|
|
|
Dear all
I am developing a website for a client in ASP.NET, Client wants to protect his webpages from copied. He asked me the following
1) Stop right click
2) Stop Context menu
3) Stop user saving and viewing source using "Save Page As" and "Page Source" in firefox. "Save As" and "view source" in internet explorer.
4) Stop taking print screen and saving it as image
In this i have accomplised the tasks 1 & 2 using javascript. is there any way to do the 3 & 4 tasks. If not possible please drop me the exact reason so i can make the client understand.
Thanks in advance
Regards
sc
|
|
|
|
|
I doubt 3 and 4 can be accomplished -- at least not in every browser.
And there is no way to completely protect the XHTML/CSS/JavaScript source (your serverside code is safe though, unless the server itself is compromised).
If someone has the will and know-how to get it, they will.
|
|
|
|
|
You can disable the menubars and tool bars using opendialog method.
If i were you, i would create a new startup page and use opendialog to launch the home page diabling the menu and tool bars.
|
|
|
|
|
rowdykuttan wrote: In this i have accomplised the tasks 1 & 2 using javascript.
And anyone can easily disable Javascript in the browser to undo that.
rowdykuttan wrote: is there any way to do the 3 & 4 tasks.
You might be able to accomplish part of task 3, but than can also easily be undone by simply requesting the page using some other program than the browser. All that is needed is a single line of code:
new WebClient().DownloadFile(url, fileName);
Anything that the browser can read can also be read by other programs, so there is no way that you can keep anyone from reading anything that you want to show on the web.
Task 4 is not possible at all using Javascript, as it's not a function in the browser, it's a function in the operating system.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
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.
|
|
|
|