|
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
|
|
|
|
|
I am looking for any good comparisons (features & functionality) between WebFOCUS and Microsoft SQL Server Reporting Services?
Thanks, Mike
"Yes I know the voices are not real. But they have some pretty good ideas."
|
|
|
|
|
we have one word template in that i want to read the content and i want change some text words and finally i want save the word.If any know this code.pls help me.
Thanks in advance.
by
sriguru
|
|
|
|
|
This[^] page from Microsoft website can explain to use the basic of Word Automation.
You will need to read more on Word Object Model to understand how things work, and here is a helpful list[^] containing code snippets on how to do things in Word.
"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
|
|
|
|
|
I have a bit of a problem... I have a need for a tree control that will do all the nice expand / collapse stuff with child nodes indented etc., but that will also have a set of columns at the right had side of each node that remain in line with each other as children are expanded/collapsed, e.g.:
<pre>
+ Node 1 col1 col2
+ Node 2 col1 col2
</pre>
We decided to 'hack' a third party control from a suite that we already use, so that when we bind the text to each node, it contains the html string to create the columns. All well and good up to this point
An example of the output html for two nodes is given below:
<DIV>
<NOBR>
<DIV id="m" align="left">
<DIV id="1t">
<SPAN class="soxProcess" style="DISPLAY: inline-block; VERTICAL-ALIGN: top; WIDTH: 50%">
<!-- Within each of these divs, i am able to add text from here -->
A long name owner test. </SPAN><SPAN style="DISPLAY: inline-block; RIGHT: 0px; VERTICAL-ALIGN: top; WIDTH: 40%; POSITION: relative">
<TABLE id="Table1" cellSpacing="0" cellPadding="0" width="100%">
<TR style="VERTICAL-ALIGN: top">
<TD style="WIDTH: 35%"><SPAN class="bodyText" style="PADDING-LEFT: 3px">A very very very very very very very very very vey long bit of text.</SPAN></TD>
<TD style="WIDTH: 35%"><SPAN class="bodyText" style="PADDING-LEFT: 3px"></SPAN></TD>
<TD style="WIDTH: 30%"><SPAN class="bodyText" style="PADDING-LEFT: 3px">INC</SPAN></TD>
</TR>
</TABLE>
</SPAN>
<!-- to here -->
</DIV>
<DIV id="m1">
<DIV id="ucDetailucTreeuwtSOXTree_1_1" igTag="PR4">
<img src="" width="25px" />
<SPAN class="soxProcess" style="DISPLAY: inline-block; VERTICAL-ALIGN: top; WIDTH: 50%"
gtxt="1">
<!-- Within each of these divs, i am able to add text from here -->
A test child for PD2 </SPAN><SPAN style="DISPLAY: inline-block; RIGHT: 0px; VERTICAL-ALIGN: top; WIDTH: 40%; POSITION: relative">
<TABLE id="Table2" cellSpacing="0" cellPadding="0" width="100%">
<TR style="VERTICAL-ALIGN: top">
<TD style="WIDTH: 35%"><SPAN style="PADDING-LEFT: 3px">PD2</SPAN></TD>
<TD style="WIDTH: 35%"><SPAN style="PADDING-LEFT: 3px"></SPAN></TD>
<TD style="WIDTH: 30%"><SPAN style="PADDING-LEFT: 3px">INC</SPAN></TD>
</TR>
</TABLE>
</SPAN>
<!-- to here -->
</DIV>
</DIV>
</DIV>
</NOBR>
</DIV>
Pretty, isn't it. My problems start to arise when i have very long text in one of the columns (as in the example). As the span containing the table is positioned absolutely, it has been taken out of the flow of the containing div, and this div does not expand to take the height of my column span into account... Any magic CSS help advice here would be much appreciated.
|
|
|
|
|
From copying and pasting your HTML script I got the 'A very very...long text' wrapping on its cell.
You don't seem to specify the position:absolute in your code either.
Can you please clarify how you want the result to be?
"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
|
|
|
|
|
Sorry, copied the code after several hours of staring at it yesterday...
The problem is not so much that it doesn't wrap (because it does), but that it pushed the text below it downwards. However, i've also come up with a dirty hack that'll do what i need, so...
anyway, here's the code i meant to post yesterday...
<DIV>
<NOBR>
<DIV id="m" align="left">
<DIV id="1t">
<SPAN class="soxProcess" style="DISPLAY: inline-block; VERTICAL-ALIGN: top; WIDTH: 50%">
<!-- Within each of these divs, i am able to add text from here -->
A long name owner test. </SPAN><SPAN style="DISPLAY: inline-block; RIGHT: 0px; VERTICAL-ALIGN: top; WIDTH: 40%; POSITION: absolute">
<TABLE id="Table1" cellSpacing="0" cellPadding="0" width="100%">
<TR style="VERTICAL-ALIGN: top">
<TD style="WIDTH: 35%"><SPAN class="bodyText" style="PADDING-LEFT: 3px">A very very very very very very very very very vey long bit of text.</SPAN></TD>
<TD style="WIDTH: 35%"><SPAN class="bodyText" style="PADDING-LEFT: 3px"></SPAN></TD>
<TD style="WIDTH: 30%"><SPAN class="bodyText" style="PADDING-LEFT: 3px">INC</SPAN></TD>
</TR>
</TABLE>
</SPAN>
<!-- to here -->
</DIV>
<DIV id="m1">
<DIV id="ucDetailucTreeuwtSOXTree_1_1" igTag="PR4">
<img src="" width="25px" />
<SPAN class="soxProcess" style="DISPLAY: inline-block; VERTICAL-ALIGN: top; WIDTH: 50%"
gtxt="1">
<!-- Within each of these divs, i am able to add text from here -->
A test child for PD2 </SPAN><SPAN style="DISPLAY: inline-block; RIGHT: 0px; VERTICAL-ALIGN: top; WIDTH: 40%; POSITION: absolute">
<TABLE id="Table2" cellSpacing="0" cellPadding="0" width="100%">
<TR style="VERTICAL-ALIGN: top">
<TD style="WIDTH: 35%"><SPAN style="PADDING-LEFT: 3px">PD2</SPAN></TD>
<TD style="WIDTH: 35%"><SPAN style="PADDING-LEFT: 3px"></SPAN></TD>
<TD style="WIDTH: 30%"><SPAN style="PADDING-LEFT: 3px">INC</SPAN></TD>
</TR>
</TABLE>
</SPAN>
<!-- to here -->
</DIV>
</DIV>
</DIV>
</NOBR>
</DIV>
|
|
|
|
|
Hi
Is there any way through which i can import my yahoo and hotmail email in my java based application? Any API or something like that?
Thank you
We Believe in Excellence
www.aqueelmirza.cjb.net
|
|
|
|
|
Of course there is an API for yahoo and msn.
Just look into their web sites, you shall find the api available there!
Jason Kataropoulos
Excellence is not an act, but a habit! Aristotle
|
|
|
|
|
Can any body help me to get a detailed book on Microsoft content management server 2002?
i am very much in a need of that.
advanced ThanX
Ramesh.Kanjinghat
|
|
|
|
|
Im looking to show the user an HTML table with about 8 rows. I want them to be able to customize the order by moving rows up and/or down in the table, then be able to send the newly-ordered list (array, string, whatever) out via a form submit. Can anyone point me in the right direction?
|
|
|
|
|
Dear Friend,
this is a bit tricky. If you have experience in JavaScript and the DOM you could use AJAX to do this.
On the other hand, if you are new to JavaScript and the DOM, I suggest you just do a post back each time you want change the order of the rows.
Jason Kataropoulos
Excellence is not an act, but a habit! Aristotle
|
|
|
|
|
My menu works fine in IE browser, but when i browse my site using mozila the menu become vertical which suppose to be horizontol.
anyone know how to solve it??
http://www.ccntech.com.my/ccn2
|
|
|
|
|
|
I'm not sure if this is the right forum, but here it goes.
I am working with a title bar with three seperate images seperated by a 1 pixel filler image. I have all the images defined in a table to allow them to dynamically shrink/expand as the window size changes.
Somehow I've ended up with aprox. a 2 pixel space between the bottom of my images and the next table row. I've worked around this, but the bottom portion of the filler images retains a different color - should be black is actually a dark blue.
The small stripe of off color is hardly noticable but my boss has eyes like an eagle when criticing(spelling ) my work.
Thanks for any help provided.
Frustrated novice,
Lil Turtle
|
|
|
|
|
Here is the code block for the header/logo bar if it helps
<asp:image id="imgLeftHeader" runat="server" width="219" imageurl="Images/LVCPD Header(left).png">
| | <asp:image id="imgMidHeader" runat="server" width="433" imageurl="Images/LVCPD Header(mid).png">
| | <asp:image id="imgRightHeader" runat="server" width="161" imageurl="Images/LVCPD Header(right).png">
|
for some reason the asp:images between the td tags don't show up in the post
The actual layout is much better, I swear:->
Lil Turtle
-- modified at 13:18 Wednesday 12th July, 2006
|
|
|
|
|
The reason for the extra pixels is that you have more than just the images in the cells. You have line breaks on both sides of the images. The line break before is usually ignored, but the line break after is interpreted as a space character (as all white space characters are in html).
When images and text are formatted together, the image is placed on the base line of the text. As a character block extends below the base line, the formatted block will be a few pixels higher than the image.
---
b { font-weight: normal; }
|
|
|
|
|
Thanks for the help, I removed the additional breaks and the image is now continuous and scalable.
|
|
|
|
|
I have the following menu control in my aspx page:
<form id="form1" runat="server">
<div>
<asp:Panel ID="Panel1" runat="server" Height="50px" Width="125px">
</asp:Panel>
<br />
<asp:Menu ID="Menu1" runat="server" BackColor="#E3EAEB" DynamicHorizontalOffset="2" Font-Names="Verdana" Font-Size="0.8em" ForeColor="#666666" StaticSubMenuIndent="10px">
<Items>
<asp:MenuItem Text = "Part I" Value="Part I">
<asp:MenuItem Text = "Chapter 1" Value="Chapter 1"></asp:MenuItem>
</asp:MenuItem>
<asp:MenuItem Text = "Part II" Value="Part II">
<asp:MenuItem Text = "Chapter II" Value="Chapter II" />
<asp:MenuItem Text = "Chapter III" Value="Chapter III" />
</asp:MenuItem>
</Items>
<StaticSelectedStyle BackColor="#1C5E55" />
<StaticMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" />
<DynamicHoverStyle BackColor="#666666" Font-Bold="False" ForeColor="White" />
<DynamicItemTemplate>
<%# Eval("Text") %>
</DynamicItemTemplate>
<DynamicMenuStyle BackColor="#E3EAEB" />
<DynamicSelectedStyle BackColor="#1C5E55" />
<DynamicMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" />
<StaticHoverStyle BackColor="#666666" Font-Bold="False" ForeColor="White" />
<StaticItemTemplate>
<%# Eval("Text") %>
</StaticItemTemplate>
</asp:Menu>
</div>
</form>
The menu display all the formatting (including color and font)correctly in VS 2005, but soon as I run my project in the web browser in debug mode(IE 6.0), the menu lost all of its formatting. The menu becomes a list of hyperlink buttons with blue color. I can't understand why and I have already spend several hours on this.
Rookie Programmer
|
|
|
|