|
reem_saeed wrote: GridView1.Columns.Add(bc) 'error here
You are doing wrong here. Why you are not using Template Field ? What is the purpose for creating Button at runtime in gridview ?
|
|
|
|
|
thanks its work >>
modified on Sunday, August 2, 2009 6:51 AM
|
|
|
|
|
Thank you for helping in advance, please see the code I attached below.
I'm currently working on integrating google maps to get the customer address from database and then display/mark the address on the google maps. So what I did was get the whole address into a hidden label control and get the text value of the control from within the javascript. The current situation is if I hard coded some value to the var address, everything works perfectly (no error and google maps display the hard coded address correctly). however when I use the document.getElementById, some error occured.
I tested the document.getElementById INSIDE the function with an alert, the alert message actually display the correct address value (as value in database), however an error ocurred IE: "Placemark.0 is null or not an object", so looks like the second function doesn't work properly. Please note that this message doesn't appear when I hard coded the var address value.
I'm not sure why, but I have a feeling that I might need to convert the document.getElementById to something, so it will become something like a hard coded value. Can someone please advice?
<script type="text/javascript" language=javascript>
var geocoder;
var map;
function load()
{
var address="new york, usa";
map = new GMap2(document.getElementById("map"));
geocoder = new GClientGeocoder();
geocoder.getLocations(address, addToMap);
}
function addToMap(response)
{
place = response.Placemark[0];
point = new GLatLng(place.Point.coordinates[1],place.Point.coordinates[0]);
map.setCenter(point,13);
marker = new GMarker(point);
map.addOverlay(marker);
marker.openInfoWindowHtml(place.address);
}
</script>
</HEAD>
<body onload="getTime();load();" onunload="GUnload()">
modified on Wednesday, July 29, 2009 9:39 AM
|
|
|
|
|
I think the problem with this is Geocoder didnt found any point near to the address you specified. Thats why the callback to addToMap throws error.
http://www.codeproject.com/KB/scripting/Use_of_Google_Map.aspx
This may help you...
|
|
|
|
|
bingo, you are my star, it's working now. it's just because of my incorrect test data, it throws the error. I have a look at the given link sample, I would like to do something similar to your sample and catch the exception, and then I tried something like below:
function load()
{
var address = document.getElementById("<%=lblmap.ClientID%>").innerHTML;
var mapaddress = document.getElementById("map");
if(mapaddress)
map = new GMap2(mapaddress);
geocoder = new GClientGeocoder();
geocoder.getLocations(address, addToMap);
}
function addToMap(response)
{
place = response.Placemark[0];
point = new GLatLng(place.Point.coordinates[1],place.Point.coordinates[0]);
if (!point)
{
alert(address + " not found");
}
else
{
map.setCenter(point,13);
marker = new GMarker(point);
map.addOverlay(marker);
marker.openInfoWindowHtml(place.address);
}
}
and of course, it didn't work. hope you could give me some idea, please.
|
|
|
|
|
I think there must be something wrong with the innerHTML.
Also check
if(response.Placemark > 0)
{
place = response.Placemark[0];
point = new GLatLng(place.Point.coordinates[1],place.Point.coordinates[0]);
}
this will eliminate your runtime error.
Other than that, put a breakpoint in the address line and see what its coming . If it is an HTML, you must strip html and get only the text address.
|
|
|
|
|
hmm...I'm not too sure what you mean by that, but maybe let me explain to you what i want to achieve.
within this code, now I can get the correct address shows up on the google map, however if the address is invalid (e.g. 123 test street, new york). then the map will not show up. my question is how can i modify the code, so that when the address is invalid, it will popup an alert saying "address not found on map", or else it will show the correct address in the map.
<script type="text/javascript" language=javascript>
var geocoder;
var map;
function load()
{
var address = document.getElementById("<%=lblmap.ClientID%>").innerHTML;
map = new GMap2(document.getElementById("map"));
geocoder = new GClientGeocoder();
geocoder.getLocations(address, addToMap);
}
function addToMap(response)
{
place = response.Placemark[0];
point = new GLatLng(place.Point.coordinates[1],place.Point.coordinates[0]);
map.setCenter(point,13);
marker = new GMarker(point);
map.addOverlay(marker);
marker.openInfoWindowHtml(place.address);
}
</script>
I tried to learn from your sample3 to do the "IF" statement, but I don't know which value to use as condition. I can only imagine "IF" the address is invalid, alert the error message, else load the map correctly.
|
|
|
|
|
I tried this, but doesn't seems to be getting it right.
<script type="text/javascript" language=javascript>
var geocoder;
var map;
function load()
{
var address = document.getElementById("<%=lblmap.ClientID%>").innerHTML;
map = new GMap2(document.getElementById("map"));
geocoder = new GClientGeocoder();
geocoder.getLocations(address, addToMap);
}
function addToMap(response)
{
if(response >= 0)
{
place = response.Placemark[0];
point = new GLatLng(place.Point.coordinates[1],place.Point.coordinates[0]);
map.setCenter(point,13);
marker = new GMarker(point);
map.addOverlay(marker);
marker.openInfoWindowHtml(place.address);
}
else
{
alert("address not found on map");
}
}
</script>
The result is it always get popup the alert, even if the address is valid. however the address never shown up on the map when the address is valid.
what can i do to make the if statement work? Please kindly help.
|
|
|
|
|
finally, I sort of got it working, although I don't think it is the best practice. my next question is i want to create a button, when click the button, it passes the address and opens up a new page with google map ONLY and its controls. this is for user to have full control over the map. Can someone please show me how to achieve this?
<script type="text/javascript" language="javascript">
var geocoder;
var map;
var place;
function load()
{
var address = document.getElementById("<%=lblmap.ClientID%>").innerHTML;
map = new GMap2(document.getElementById("map"));
map.addControl(new GSmallMapControl());
geocoder = new GClientGeocoder();
geocoder.getLocations(address, addToMap);
}
function addToMap(response)
{
if (response.Placemark != null)
{
place = response.Placemark[0];
point = new GLatLng(place.Point.coordinates[1],place.Point.coordinates[0]);
map.setCenter(point,16);
marker = new GMarker(point);
map.addOverlay(marker);
marker.openInfoWindowHtml(place.address);
}
else
{
alert("Sorry, map not available");
}
}
</script>
|
|
|
|
|
Also you place
var element = document.getElementById("map");
if(element)
map=new GMap2(element);
Instead of
Member 4683620 wrote: map = new GMap2(document.getElementById("map"));
|
|
|
|
|
Eg.There are Company Menu ( include Office Personnel menu sub menu, Personnel sub Menu ) and System Administration Menu (include Security Setup Sub Menu and Data Access sub Menu)
|
|
|
|
|
Please don't explain in the subject. write your problem in your body. try again.
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
i am confused with API. i want to know what are APIs, how it is used and implemented in project.
i want it in simple laymans language for clear understanding
|
|
|
|
|
Wiki has a very simple(infact, in layman's language) article [^]describing APIs
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
from today on, you must Google before you ask a question on the forum
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
In computer science, an application programming interface (API) is an interface that defines the ways by which an application program may request services from libraries and/or operating systems.[1][2][3] An API determines the vocabulary and calling conventions the programmer should employ to use the services. It may include specifications for routines, data structures, object classes and protocols used to communicate between the requesting software and the library.
When used in the context of web development, an API is typically a defined set of Hypertext Transfer Protocol (HTTP) request messages along with a definition of the structure of response messages, usually expressed in an Extensible Markup Language (XML) or JavaScript Object Notation (JSON) format. While "Web API" is virtually a synonym for web service, the recent trend (so-called Web 2.0) has been away from Simple Object Access Protocol (SOAP) based services towards more direct Representational State Transfer (REST) style communications[5]. Web APIs allow the combination of multiple services into new applications known as mashups [6].
|
|
|
|
|
Hello, This is Vikash.
I am facing problem displaying the windows control created by me in ASP.net web site.
Actually, I am totally new to this and haven't done this thing before.
But after searching some article on the web i have created a small windows control with 2 textboxes and a Command button. When the button is clicked it copies the text in textbox1 to textbox2.
This is the Code of my User Control:
Imports System
Imports System.Windows.Forms
Imports System.Runtime.InteropServices
Public Class Copytext
Public Sub New()
' This call is required by the Windows Form Designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox2.Text = TextBox1.Text
End Sub
End Class
When I run the project of User Control, it runs fine.
Next I Created a web site in the same Solution and pasted the DLL file of UserControl in the roor directory and then using OBJECT tag embed the control in Web Page.
Code for WebPage is as follows:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<object id="MyX" classid="WindowToWeb.dll#WindowToWeb.Copytext" style="width: 312px; height: 160px"></object>
</div>
</form>
</body>
</html>
But when i run the web page it displays just a blank box.
can someone please tell me or guide me in this matter.
Any help would be greatfull.
Thanks in Advance.
|
|
|
|
|
look at this
http://www.beansoftware.com/ASP.NET-Tutorials/Place-Windows-Control-To-Web-Form.aspx[^]
It will help
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Hello, Thanks for your reply.
But the problem still exists, I have done what is given in the link, but no success.
Is there any setting in the IE that could be the problem.
Please more help needed.
Thanks in advance.
|
|
|
|
|
Am not because i dont know what does your control do, but please make sure that you have registered it in the aspx page.
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Hi All,
I have table in which I have to put fixed header and freezed header widths. It is working when I dont scroll the vertical scroll bar. When I drag on the vertical scroll bar the widths are reduced.
Can anybody please tell me the widths of the table header remain same even if the scroll is moved.
I have used the following CSS and table's td tags.
.HeaderFreez
{
position:relative ;
top:expression(this.offsetParent.scrollTop);
z-index: 10;
}
<tr class="HeaderFreez">
<th class="RowHeader2Cell1" align="left" style="white-space:nowrap;width:80%;">Asset Name</th>
<th class="RowHeader2" align="right" style="white-space:nowrap;width:20%;">CUSIP</th>
<th class="RowHeader2" align="right" style="white-space:nowrap;width:20%;">ISIN</th>
<th class="RowHeader2" align="right" style="white-space:nowrap;width:20%;">SEDOL</th>
<th class="RowHeader2" align="right" style="white-space:nowrap;width:20%;">Ticker</th>
<th class="RowHeader2" align="right" style="white-space:nowrap;width:20%;">Current Allocation</th>
<th class="RowHeader2" align="right" style="white-space:nowrap;width:20%;">Quantity</th>
<th class="RowHeader2" align="right" style="white-space:nowrap;width:20%;">Current Price</th>
<th class="RowHeader2" align="right" style="white-space:nowrap;width:20%;">Date Priced</th>
<th class="RowHeader2" align="right" style="white-space:nowrap;width:20%;">Market Value</th>
<th class="RowHeader2" align="right" style="white-space:nowrap;width:20%;">Total Cost</th>
<th class="RowHeader2" align="right" style="white-space:nowrap;width:20%;">Unrealized Gain/Loss</th>
<th class="RowHeader2" align="right" style="white-space:nowrap;width:20%;">Estimated Annual Income</th>
<th class="RowHeader2" align="right" style="white-space:nowrap;width:20%;">Yield</th>
<th class="RowHeader2" align="right" style="white-space:nowrap;width:20%;">Portfolio</th>
</tr>
Thanks a Lot,
Md Abdul Aleem.
Thanks & Regards,
Md. Abdul Aleem
NIIT technologies
|
|
|
|
|
This is no ASP.Net question.
CP has a seperate Web Development forum [^]for this.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
on local host my web work well......but on web server bellow error shown:
Parser Error Message: Could not load the assembly 'App_Web_g2f21cnt'. Make sure that it is compiled before accessing the page.
Source Error:
Line 1: <%@ page language="C#" autoeventwireup="true" inherits="_Default, App_Web_g2f21cnt" %>
Line 2:
Line 3: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Can anybody tell me where is problem?
thanks
|
|
|
|
|
Am not sure what is the problem , because this is not common. please give us more info on what did you do before you put it in your webserver
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|