Command button to trigger an event

Hi Guys,

I know I am about to ask a very silly question, but how do I get my command button to show my google map only when it is clicked.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Silly answer:
1) Open designer.
2) Drag Asp:Button from toolbox to your page.
3) Double click on button.
4) Add your code to generated click event handler
xmalcolmAuthor Commented:
Yes I know that but what code do I need to put in? In the aspx.cs file I already have:

protected void btnSearch_Click(object sender, EventArgs e) {


But what I want is for the google map to only initialise when this command button is clicked.
Well, if you are not going to build commercial site, try

Very simple Asp.Net control. Just add reference to dll, register control
<%@ register assembly="GMaps" namespace="Subgurim.Controles" tagprefix="subgurim" %>

and place to your page:
<subgurim:GMap ID="GMap1" runat="server" />

And button click:
protected void Button1_Click(object sender, EventArgs e)
    GMap1.setCenter(new GLatLng(51, 12), 6);

xmalcolmAuthor Commented:
I found an easier way to do it. That is by making another page and having a Response.Redirect ("ToYourPage.aspx") command assigned to the command button. But thanks anyway.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.