|
What exactly will that do? Stop the user from right clicking? ONLY if they have javascript enabled, AND it won't be fired when they hit the file menu!, not to mention how bad practice it is!!! The amount of rubbish that gets suggested here is unbelievable.....
|
|
|
|
|
So suggest something better.
|
|
|
|
|
|
Yes, sorry. I was working top to bottom and replied before getting to your next post.
|
|
|
|
|
You can't, you have absolutely no control over the browser, any javascript/applet/activex solution can always be worked around if someone really wants to do it. There is no point in trying to control what the user does with your site, its impossible, just let them get on with it.
I should note (in case you didn't understand this) that they can only get the HTML page and resources, not the aspx or code behind.
|
|
|
|
|
Can u suggest any other way to stop the visitor from saving and printing the contents from my application
|
|
|
|
|
If its a web application you can't, full stop, end of story.
|
|
|
|
|
Please don't.
Many many people post similar - the usual is "how can I disable the right-click menu". The problem is, all it achieves is narking off your user - changing expected functionality is never a good idea.
Also, without sounding rude, a very wise man once said "what makes you think that anyone is going to be interested in your content that much anyway"
Additionally, even if you do manage to disable it, there are a ridiculous number of methods to still get access to what you've done!
"Knock me down, I'll get straight back up again, I'll come back stronger than a powered up pacman"
(Lilly Allen / Kaiser Chiefs)
|
|
|
|
|
Hi! in my application i have to insert mor than one records in the database. for this i prepare a dataset containing all the records in a table. now i want to insert all these records preserving ACID property. how can i do this?
Thanks & Regards,
SAMir Nigam,
Software Engineer,
STPL, Lucknow, India.
|
|
|
|
|
Hi,
i have a problem regarding database,
I have a db and fetched the data from db through dataset, and at same time another user fetches the same data and updates the db.
Now i confirmed the changes through dataset.haschanges() method and now i want to update the database with my changes
how can i get this functionality, both users working on same data
Can someone clarify me how can i proceed
Thanks
Mukkanti
|
|
|
|
|
I want to seach the data based on the value entered in the text boxes and dropdown list.
I have written the folling code. but getting error "Incorrect syntax near the keyword 'and' while running. What can i do for this?
Sub bindresult(ByVal sqlstr As String)
Dim ds As New DataSet()
Dim comm As New SqlDataAdapter(sqlstr, dbconn)
dgresult.DataSource = ds
comm.Fill(ds)
dgresult.DataBind()
navi.Visible = True
lblnopg.Text = dgresult.PageCount
End Sub
Protected Sub Btnsearch_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Btnsearch.Click
If Txtascd.Text.Trim = "'" Then
Txtascd.Text = ""
Exit Sub
End If
If txtip.Text.Trim = "'" Then
Txtascd.Text = ""
Exit Sub
End If
If txtmobile.Text.Trim = "'" Then
Txtascd.Text = ""
Exit Sub
End If
dgresult.CurrentPageIndex = 0
ViewState.Remove("vstr")
If Txtascd.Text.Trim <> "" Then
vstr = " and assetcode='" & Txtascd.Text.Trim & "'"
ViewState("vstr") = vstr
End If
If Ddmodel.SelectedIndex <> 0 Then
vstr = " and model='" & Ddmodel.SelectedItem.Text & "'"
ViewState("vstr") += vstr
End If
If txtmobile.Text.Trim <> "" Then
vstr = " and mobile='" & txtmobile.Text.Trim & "'"
ViewState("vstr") = vstr
End If
If txtip.Text.Trim <> "" Then
vstr = " and ip='" & txtip.Text.Trim & "'"
ViewState("vstr") = vstr
End If
vstr = ViewState("vstr")
sqlstr = "select 'LNO'=assetcode,'SerialNo'=serialno,'Model'=model,'Mobile'=mobile, 'IP'=ip from A_laptops " + vstr + " order by lno asc"
ViewState("sqlstr") = sqlstr
bindresult(sqlstr)
End Sub
|
|
|
|
|
Hi,
There is no "where" clause in your query and if I am understading your code correctly your sqlstr would be as following.
Let say your first and last condintions are true and you have "abc" in Textascd.Text and "123" in txtip.text so your vstr would be
vstr = " and assetcode='abc' and ip='123'"
now id u put this in your sqlstr expression your final sqlstr would be
select 'LNO'=assetcode,'SerialNo'=serialno,'Model'=model,'Mobile'=mobile, 'IP'=ip from A_laptops and assetcode='abc' and ip='123' order by lno asc
here you dont have "where" in your query and even if u have then also after where you can not have "and". Thats why its giving error.
Put some logic to remove first "and" from the final query.
I hope this will help you.
Thanks and Regards,
Chetan Ranpariya
|
|
|
|
|
Hi Chetan,
I had tried by giving where,
sqlstr = "select 'LNO'=assetcode, 'SerialNo'=serialno, 'Model'=model, username, 'Mobile'=mobile from A_laptops where assetcode='" & Txtascd.Text.Trim & "' or mobile='" & txtmobile.Text.Trim & "' or model='" & a & "'or firstname='" & txtfname.Text.Trim & "' or lastname='" & Txtlname.Text.Trim & "'" + vstr + " order by lno asc"
When i enter some data in text box or select from drop down list, it works. But when all control are empty and if click search, it i want it to display all the rows present in the table,
if is give,
sqlstr = "select * from A_laptops" + vstr + " order by assetcode asc"
then, selected rows will not get displayed.
Do I have any alternative for this?
|
|
|
|
|
Hi, I got it thank you.
I just took the two aliases for the same table and compared their primary keys. Now it is working fine. Thank you.
sqlstr = "select 'LNO'=al.assetcode, 'SerialNo'=al.serialno, 'Model'=al.model, al.username,'Mobile'=al.mobile from A_laptops al, a_laptops ap where al.assetcode=ap.assetcode" + vstr + " order by lno asc"
|
|
|
|
|
Why do people continue to ignore best practices and use dynamic SQL statements with no validation, in a web application no less.
only two letters away from being an asset
|
|
|
|
|
hi guys,
i got an error while i was migrating one of the webproject developed in
1.1 to 2.0. i got error in one dll reference in global.asax.
it says
"The type 'Ims.Tmpc.Global' is ambiguous: it could come from assembly
'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\tmpc\0645d1b5\4ea8c73e\App_Code.h0ihzjo3.DLL' or from assembly
'c:\inetpub\wwwroot\tmpc\bin\Tmpc2003.DLL'. Please specify the assembly
explicitly in the type name.
"
i need thesolution for this pbm...its urgent....
if anyone know what is wrong here, please share your knowledge
with me.
thank u
|
|
|
|
|
1. "Urgent" as a subject is not likely to get many replies, we don't care how urgent it is, we're here because we want to help out of the goodness of our hearts....awwwww
2. The problem seems pretty self explanatory to me, have you even looked into it? Theres a problem with one of your assembly references.
|
|
|
|
|
Thks for ur advice......ya i solved the issue.......
thank u
|
|
|
|
|
Most of your posts are marked 'urgent.' Please title your messages appropriately.
______________________
stuff + cats = awesome
|
|
|
|
|
Hi all,
I would like to get the value of a label from the same row after clicking the delete button. I converted the delete button into a template field and tried the following code
Dim a As String = ""
a = CType(GridView1.FindControl("label1"), Label).Text
It gives me an error saying that object reference not found, and use the NEW keyword to declare a new object instance. I tried declaring NEW on string but gives me an error.
What should I do?
Best Regards,
Aaron Neo
|
|
|
|
|
Hi
Where did you put that code ?? If it is RowCommand Event of Gridview, you should set command name for the button.
Try this...
if (e.CommandName == "Insert")
{
Label lbl = (Label) e.FindControl('Label1');
String StrLabel = lbl.Text.ToString();
}
Harini
|
|
|
|
|
Hi,
Thank you so much for your reply. I tried your coding but it can't work. "Label is a type and cannot be used as an expression"
I have converted the button into a template field. I have placed the codings in the button click event:
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Best Regards,
Aaron
|
|
|
|
|
Hi,
I am developing an web application in VS2005 in which the current windows user is Authenticated against the Active directory.It is working fine with vs2005 webserver but when I host my application with IIS it shows an error of "Server not found".
How will I overcome to this problem.
Thanks in Advance
Alok Kumar.....
|
|
|
|
|
Hi everyone
i have problem in my webpage.... I am dynamically binding the data to tje checkboxlist. let us say i select only few of them and go to next page for selecting some more.... and when i come to previous page the selected values are cleared to say the have be unchecked.. so hw to overcome this problem...
thanks in advance
Devkranth
|
|
|
|
|
Hi,
Before moving to the next page you should save selected values in session and use that to get values when come back to the previous page.
Thanks and Regards,
Chetan Ranpariya
|
|
|
|