|
No, my button is not marked as runat="server"
HilSoft
|
|
|
|
|
ah, it's the little things in life...
|
|
|
|
|
Now I've understood. I has been taken the button from the HTML palette, and this is a fault in the case. You shold take a button from a usual FORM-palette, and then it works correcty! The reaction is shown in *.cs listing, when you can code. (Thanks to the Russian master Gaidar Magdanurov <gaidar.magdanurov@gmail.com>)
The question is closed.
HilSoft
|
|
|
|
|
Hi
I'm stuck with this data entry page in asp which I haven't programmed and it has some problems. this page inserts records into three different tables (SQL database).
The page has the insert statement starts with insertsql = "DECLARE @UserID int" followed by the insert statements. This id is inserted into the three tables as a primary key that connects them. the problem is that I'm trying to pass this id to another page which retrieves data according to this id. I'm already a beginer in ASP and I tried many times to declare a variable that can handle this ID and pass it through a session to the other page, but still nothing is working.
Is it possible to capture this variable UserId from the sql insert statement? if not what other ways can i solve this issue?
|
|
|
|
|
Could you just add a select at the end of the three insert statements, e.g.:
SELECT @UserId
And then set an asp variable to the return recordset value...
|
|
|
|
|
Which runs faster? ASP or JSP? I ve these two options - performance wise..
|
|
|
|
|
On today's computers and with the JVM's out there today, I'd say both run about equally as fast. Personally, I like JSP when I'm running my own server (running tomcat). If you are using a hosting company to host your site, I'd definately use asp. Unless you want to spend quite a bit of money, most of your java hosts use a shared VM for your site, and they are not very much fun to work. Otherwise, I'd say both perform about equally performance wise...it just comes down to language preference then.
Brian Van Beek
Inside this room, all of my dreams become realities, and some of my realities become dreams. -Willy Wonka
Read my Blog, I know you want to... [^]
|
|
|
|
|
hi
As i penetrate deeper into the "Secrets" of Web Development, i am somewhat confused about the Database backend of my web applications.
I suppose I am looking for a tutorial that will combine the three Elements i posted in the Subject.
Maybe i am just blind, but i have done quite a lot of searches, and can not seem to find a tutorial that will cover the basics of SQL, DAL, BLL, and the idea behind them.
Maybe someone could summ up in this topic, or better jet post a link to an exsisting tutorial that will cover the follwing aspects:
-Database Design (What Datatype for wich field an why, relationships of tables, views, storedprocedures, complex Select statements (select within another select?)
- Data Access Layer - why do i need it, what are the pros/cons, how do i do it? are there Industry Standards? what are they?
- Buissness Logic Layer - (same idea as the DAL) why do i need it - how else could i do it...
i am sure this would not only help me, but also very many other people out. The tutorials i have found so far, seems to go into detail on the individual subjects quite quickly and dont seem to just give an overview of the entier idea behind the system.
~Skyruner2
|
|
|
|
|
|
|
I have html control on my page. It's property position set in "relative". Can I get it's absolute position from Javascript? And it what way can I do this?
Thank's
|
|
|
|
|
The "simple" answer is not always...
You need recursive program asking for the parent's left, top, width, height, border and so...
But the thing is unsolvable if you use percentile measures (IE: style="width: 100%") because this measures depends on the screen resolution.
I've tried... And I can't solve certain aspects.
I'm on a Fuzzy State: Between 0 an 1
|
|
|
|
|
Hi,
I am facing a problem in my web application while i am trying to print an html page, whose url is specified in a textbox, using axWebBrowser component. I am getting an error "Exception of type InvalidActiveXStateException was thrown", at axW.Navigate statement. Please help me to rectify this problem.
private void Button1_Click(object sender, System.EventArgs e)<br />
{<br />
try<br />
{<br />
object empty= null;<br />
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(WebForm1));<br />
AxWebBrowser axW=new AxWebBrowser();<br />
axW.Enabled=true;<br />
axW.Visible=false;<br />
axW.OcxState = (System.Windows.Forms.AxHost.State)(resources.GetObject("axW.OcxState"));<br />
axW.Navigate(TextBox1.Text,ref empty,ref empty,ref empty,ref empty);<br />
axW.ExecWB(SHDocVw.OLECMDID.OLECMDID_PRINT,SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER ,ref empty,ref empty);<br />
}<br />
catch(Exception Ex)<br />
{<br />
Response.Write(Ex.Message.ToString());<br />
} <br />
}
This application is a web application and I want the print at the server end since the server is the user in our case.
If it is not possible to print with this control in a web application, Is there any other way to print an html page without loading it and not to show any print dialog at the user end.
Please help me with this case.
Thanks in advance,
Sai.
|
|
|
|
|
Please don't cross post.
---
b { font-weight: normal; }
|
|
|
|
|
is it possible that i use microsoft access as my databse for my website on customer infomation???
i'm not sure is it save to do that or not..
any suggestion? i heard alot more website using asp or PHP but i not really familir which those language, any website to guide on how to have a secure databse?
Wat is the database file extension for asp? i only know access is .mdb
|
|
|
|
|
Yes, you can use MSAccess as your database, however it is NOT recommended aside from using it for student assignment. It is better for you to use the free MSDE, SQL 2005 Express, or MySql.
ASP and PHP are not databases, they are web programming languages (to create a web page) similar to ASP.Net.
File extension for ASP files are .asp, and php are .php (I believe both can be changed if you feel like it).
"You are special, but so is everybody else."
"Democracy is two wolves and a sheep voting on what to have for dinner" - Ross
Edbert
Sydney, Australia
|
|
|
|
|
but will it be safe? casue i'm going to implement a business site store on customer information...
|
|
|
|
|
Obviously if you're going to develop a business site store you're better off with MSDE/SQL Express 2005, or MySql than Access.
"You are special, but so is everybody else."
"Democracy is two wolves and a sheep voting on what to have for dinner" - Ross
Edbert
Sydney, Australia
|
|
|
|
|
Yes you can use the access database for the web application i.e. asp or asp.net
Mahi
|
|
|
|
|
Hello!
I can type in the value in one text box, then it'll go to the code behind of another page and do the correct functionality....which will tell the user if the number is distinct or not.
The only problem is when I post back the page via the button_click event, I get an IE error, iexplore.exe error, The instruction at "0x4a594476" referenced memory at "0x00000004". The memory could not be "read".
HTML code is:
<HTML>
<HEAD>
<title>WebForm1</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
<!-- Start script -->
<script language="javascript">
var xmlHttp = createXmlHttpRequestObject();
function createXmlHttpRequestObject()
{
var xmlHttp;
if(window.ActiveXObject)
{
try
{
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e)
{
xmlHttp = false;
}
}
else
{
try
{
xmlHttp = new XMLHttpRequest();
}
catch (e)
{
xmlHttp = false;
}
}
if (!xmlHttp)
{
alert("Error creating the XMLHttpRequest object.");
}
else
{
return xmlHttp;
}
}
function process()
{
varWBS = encodeURIComponent(document.getElementById("TextBox1").value);
xmlHttp.open("GET", "test.aspx?WBS=" + varWBS);
xmlHttp.onreadystatechange = handleServerResponse;
xmlHttp.send(null);
}
function handleServerResponse()
{
//if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
//{
// document.getElementById("show").innerHTML = xmlHttp.responseText;
//}
//}
//New code
if (xmlHttp.readyState == 4)
{
if(xmlHttp.status == 200)
{
var parentElement = document.getElementById('show');
var wrappingDiv = document.createElement('div');
wrappingDiv.innerHTML = document.getElementById("TextBox1").value+' '+xmlHttp.responseText;
parentElement.appendChild(wrappingDiv);
//document.getElementById("show").innerHTML = xmlHttp.responseText;
//document.all[show].innerHTML = xmlHttp.responseText;
}
else
{
alert("hmmmm");
}
}
}
//End code
</script>
<!-- End script -->
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<table id="maintbl" border="1" style="WIDTH: 952px; HEIGHT: 59px">
<tr>
<td style="WIDTH: 327px"><asp:textbox id="TextBox1" onblur="process()" style="Z-INDEX: 101" runat="server" Width="100%"></asp:textbox></td>
<td><asp:textbox id="TextBox2" style="Z-INDEX: 101" runat="server"></asp:textbox></td>
</tr>
<tr>
<td colspan="2">
<div id="show" style="FONT-SIZE: smaller; COLOR: red" runat="server"></div>
</td>
</tr>
<tr>
<td colspan="2">
<asp:Button id="Button1" runat="server" Text="Button"></asp:Button>
<asp:Label id="Label1" runat="server">Label</asp:Label>
</td>
</tr>
</table>
</form>
</body>
</HTML>
The code behind for the test.aspx page is:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
sCon1.Open()
Dim strSQL As String = "Select count(*) from Table where [Number] = '" & Server.HtmlEncode(Request.QueryString("WBS")).ToString() & "'"
Dim cmd As New SqlCommand(strSQL, sCon1)
Dim intCnt As Integer = cmd.ExecuteScalar()
sCon1.Close()
If intCnt = 0 Then
Response.Write("is unique, and able to be added!")
Else
Response.Write("is already used. Please select another Number!")
End If
Catch ex As Exception
Response.Write(ex.ToString())
Finally
sCon1.Close()
End Try
|
|
|
|
|
The error may have been caused by this part of your code:
var parentElement = document.getElementById('show');
var wrappingDiv = document.createElement('div');
wrappingDiv.innerHTML = document.getElementById("TextBox1").value+' '+xmlHttp.responseText;
parentElement.appendChild(wrappingDiv);
Try appending the div to the parent element first before setting the value, and you may want to use innerText instead of innerHTML.
Also, is your xmlHttp.responseText a HTML script? If yes, that might be the cause of the problem.
You're better off writing your html via javascript than setting it via innerHTML property.
"You are special, but so is everybody else."
"Democracy is two wolves and a sheep voting on what to have for dinner" - Ross
Edbert
Sydney, Australia
|
|
|
|
|
First of all, please have a look the belowed html code
--------------------
--------------------
the doAction() function should post hidden field to http://www.servername.com and the response data will be represented in a new open window for setting "_blank" to target. Actually, "userid=1" will post to destination howerver I wanna post custom data , for instance, a piece of xml to destination url and the data should not always with the format "xxx=xxxxxx". How to do this??
As you know, httpXml should post custom data you want to destination url with response data in httpXml.ResponseText, but how to simulate the feature of target="_blank" in form, which responds to new window and user can continue to communicate with destination server via the new window.
Thanks in advanced
Benjamin Li
|
|
|
|
|
Since you're going to open a new window, why do you need to use XmlHttpRequest to post it?
Just modify the action attribute of the form to submit the page to another page of your liking, and submit the form.
If you keep the form's target as "_blank" then it will open in another window and you can continue from there.
"You are special, but so is everybody else."
"Democracy is two wolves and a sheep voting on what to have for dinner" - Ross
Edbert
Sydney, Australia
|
|
|
|
|
As mentioned in my post, form always post data like "xxx=xxxxx" to destination url but I just wanna post customized data, for instance, a xml stream to destination url. So I have no idea how can form do that. If you have any suggestion, could you give a sample?
Regards,
Benjamin Li
|
|
|
|
|
Sorry, I didn't get any e-mail notification so I didn't get back to you earlier.
There are plenty of samples in using XmlHttpRequest to post customised data to another page, you can either Google it or search CodeProject.
You can also have a look at Anthem.Net[^] to see if it fits the bill, or even to peek at how it uses XmlHttpRequest to post data.
I prefer using whatever is available out there in order to not reinvent the wheel.
"You are special, but so is everybody else."
"Democracy is two wolves and a sheep voting on what to have for dinner" - Ross
Edbert
Sydney, Australia
|
|
|
|
|