Please Help!! web parts and .net forms

This is a two part question.

1. i have a simple .net form that captures users input and i want to post to another form to show users input and data from a database into a data grid. In keep posting back to the first form. I have action and method set correctly on my first form, no idea why it post to same form. i even have a response.redirect in the click event of the button on the first form.

2. Does anyone know of any good site/web cast that step you through a basic web part for sharepoint 2007 i am using both visual studio 2005 and 2008. I heard that it is like a 12 step process once your code is done is this correct? I found this site:

http://naspinski.net/post/WSS-30MOSS-2007-Web-Part-Tutorial.aspx

   - and it looks like all he wants me to do is hit the deploy link, i did that and got this error message:  No sharepoint site exists on specified URL

  - also i noticed when you create a basic webpart it gives you a default class called webpart1, if you want to rename that to somthing related to your project do you have to change the name every where in the class, xlm and webpart files,

3. Is anyone seeing this site to be very very slow. 

 

 

0
billyboyva
3/12/2009 5:19:46 PM
asp.net.getting-started 91979 articles. 3 followers. Follow

3 Replies
1023 Views

Similar Articles

[PageSpeed] 15

Hi,

As for the first question, I suggest to use the following code to insert the data to the database.

.aspx file

    <form id="form1" runat="server">
    <div>
        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
        <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="save" />
    </div>
    </form>

.cs file

  protected void Button1_Click(object sender, EventArgs e)
    {
        //insert the data into the database
        SqlConnection conn = new SqlConnection("server=.;database=Test;uid=sa;pwd=issac");
        SqlCommand cmd = new SqlCommand("insert into test(name) values(@name)", conn);
        cmd.Parameters.Add("@name", SqlDbType.VarChar);
        cmd.Parameters[0].Value = TextBox1.Text;
        conn.Open();
        cmd.ExecuteNonQuery();
        conn.Close();
        //goto another page
        Response.Redirect("Default4.aspx");
    }

 

As for the second question, I suggest to post it to the following forum.

http://forums.microsoft.com/msdn/default.aspx?ForumGroupID=328&SiteID=1

 

Please feel free to let me know if I’ve misunderstood anything.


Sincerely,
Zong-Qing Li
Microsoft Online Community Support
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as
Answer” if a marked post does not actually answer your question.
0
Zong
3/16/2009 5:38:25 AM

I did somthing simular:

protected void btReport_Click(object sender, EventArgs e)

{

Response.Write(
"button click");

Response.Write(Page.IsValid);

if (Page.IsValid)

{

 

 

// Need to loop through selected focuse areas:

foreach (ListItem li in AreasInterest.Items)

{

if (li.Selected)

{

focusAreasSelected += li.Text +
"; ";

 

}

}

}

 

Session[
"hdFocusAreas"] = focusAreasSelected;

//Server.Transfer("reportResults.aspx");

Response.Redirect("reportResults.aspx");

}

but as soon as i issue the redirect it does not go to the new page it calls the current pages load event.
0
billyboyva
3/16/2009 5:30:28 PM

Hi,

As far as I know, the page_load event will be executed before the button click event. So I suggest to check the code in the page_load event.

In addition, please test the following code.

.aspx file

    <form id="form1" runat="server">
    <div>
        <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
    </div>
    </form>

.cs file

    protected void Page_Load(object sender, EventArgs e)
    {
     //check the page load code
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        Response.Write("button click");
        Response.Write(Page.IsValid);
        if (Page.IsValid)
        {
            // Need to loop through selected focuse areas:
        }
        Session["hdFocusAreas"] = "test";
        //Server.Transfer("reportResults.aspx");
        Response.Redirect("reportResults.aspx");
    }

 

I look forward to receiving your test results.


Sincerely,
Zong-Qing Li
Microsoft Online Community Support
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as
Answer” if a marked post does not actually answer your question.
0
Zong
3/17/2009 2:18:05 AM
Reply:

Similar Artilces:

getting start with vb.net and crystal repots(web form)
I use Crystal Report9 in Visual Studio.NET 2003..... Example at Northwind database I want a application that.....a form include a combobox that contain CustomerID.....If I choose one CustomerID and click OK button....a Report will display information about this Customer......I think that must use Paramater.....how to do that ???? (How do I start to coding --please step by step or sample) please help me !!! Thank you so much!!! very good I have Dropdownlist when I choose the 'month'--> the all data of this field will show I use this Private Sub ddlMonth_Sel...

VS.NET Web App messing up form authentication? Help, please?
Does anyone know of any problems with creating a VS.NET Web App in a forms authenticated subfolder? I created a Web App "pics" with VS.NET as a subfolder of wwwroot, and the Request.ServerVariables("AUTH_USER") is always blank on all the pages in this subfolder wwwroot/pics. I deleted the VS.NET premade Web.Config file so that there is only the one file at wwwroot, but that didn’t help. Are there any other files created by VS.NET that could be messing this up? I made other ASPX subfolders outside of VS.NET and they all continue the session just fine, it's like this ...

Desperate Visual Studio .NET problem with Web Forms, please help
Hi, I've posted in the past about this problem and got no response, but now I'm desperate so have to try again. In Visual Studio .NET 2003, with .NET Framework 1.1, all web form controls (in fact all controls in the toolbar) are disabled. I create a webform.aspx page, I am in design view, but when I go to the "web forms" toolbar, I cannot drag anything to the page. I solved this last time by completely wiping my drive and spending three days reinstalling and updating everything. Everything in Visual Studio worked as expected for a few days, and now yet again everything is disabled. Can s...

Implementing .Net Form into an APS.net web form, can this be done
I am new here, but have been searching for a while, and may not have the correct lingo to find what I am looking for.  I am tasked with implementing a .exe application that was writen vb6 then converted to .net into a new website my team is developing. The idea is to put each of the 3 different forms in this .exe application of 3 different .aspx pages. I have attempted multiple things to get this into the page and even started to just rewrite it as an ASP.net web form, but even then I can't reuse any of the code since the System.Web.UI.Page doesn't inherit the sa...

Funny character being added instead of spaces in .net web forms...please help
Hi,in all of my asp.net pages I have the following html code:&nbsp;&lt;TD class=padding colSpan=2 height=23&gt;&lt;div align="center"&gt;&lt;A &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; href="#"&gt;Privacy Policy&lt;/A&gt; »&lt;a href="#"&gt; Terms of Use&lt;/a&gt;&lt;/div&gt;&lt;/TD&gt;on my default.aspx page, this gets displayed as: Privacy Policy » Terms of Useand the code isPrivacy Policy » Terms of UseCan ...

I cannot get my C#.NET Email Form to work on Godaddy hosting account. Please Help!!!!
Hello;   I have created a contact us page and I am using .NET Mail classes to send the form via email. However I keep getting this error when I upload my info to the hosting server... Request for the permission of type 'System.Net.Mail.SmtpPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. Oh and yes, it wont send any emails. here is my code... using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.Web...

Help getting started with a dynamic web form
I'm new to .NET so I was hoping someone could point me in the right direction. I have a form that needs to be dynamically created based on the contents of a XML file. The XML contains data for each 'row' to be created and what type of fields (textbox, custom select box, etc) should be displayed. The number of each type of field will vary from time to time. Using ASP I would have either used XSL to create a form or DOM to walk through the contents of the XML and display/name the proper fields. Using .NET I'm not sure what the proper method is to accomplish my goal. I can use XML c...

How To Convert c#2005.net web template to vb2005.net Forms Template
I need  Convert c#2005.net web template to vb2005.net Forms Template   There are some free c# to vb converters out there which will allow you to upload a project and convert it to vb.   The programming models for windows forms and web projects are very different there is no way to convert a web to windows forms project.   http://www.carlosag.net/Tools/CodeTranslator/Default.aspx      Silverlight-helpVb TipsSpace Coast .Net User Group Hey Ajax-y, This tool really helps all programmers. I thought I would share this wit...

HELP Running a web-site with .NET 2.0 and NET 1.1
Hi evreybody,  I have a HUGE problem. I running a website that I have just created with ASP .NET 2.0 technology, well within my web site there is an web application that needs to run under V1.1. I'm using IIS 6.0 and I was wondering to see if anybody can help me run my new site, and run that web app at the same time. Basically is two sites within one web directory, the way you acces both sites is by the same link, just one is ROOT/default aspx (V2.0) and the other is Root/webapp/default.aspx (v1.1) can anybody help me... :( THANK you you will have to define them as two separate w...

Sharepoint help! Error msg : "A Web Part or Web Form Control on this Web Part Page cannot be displayed or imported because it is not registered on this site as safe"
hihi, I have set up a testing virtual server on my local machine. I installed win server 2003, wss 2.0, sql server 2000, and visual studio .net 2003. i tried to create a project in C# but when i build it and import the web part (.dwp) into the page, there is this error msg "A Web Part or Web Form Control on this Web Part Page cannot be displayed or imported because it is not registered on this site as safe"  I seached most of the sites and they informed that the problem lies in the safe control in web.config i enter the safe control in web.config but i does not know where to put ...

Type.GetType does not work in VB.NET but works in C#. VB.NET gurus Please help
Friends,   I am an experienced C# programmer who is working on a VB.NET project now. I am writing different methods covering the following functionalities 1) Take a datareader as input and return an arraylist of class object2) Take an xmlnode (received from a webservice) as input and return an arraylist of class object. The methods are generic methods which take datareader/xmlnode as first parameter and classname (string) as the second parameter. This way it will work trivially. The schema of class object matches with the input (datareader or xmlnode)In C# I used to do th...

non .net form issue within a .net form tag
this may be a bad question... but I am adding a shopping cart to my asp.net website and it calls for the following code for the 'buy now' buttons: <form method="POST" action=http://www.cart.net/cart.aspx/CartName><input type="hidden" name="ID" value="IDName"><input type="hidden" name="Describe" value="IDName Description"><input type="hidden" name="Price" value="100.00"><input type="hidden" name="QtyMax" value="1"><input t...

To anyone who has deployed web service with VWDHosting.net: Help please!
I'm trying to get my web service to work on VWDHosting.net, but it keeps coming up with parser error: Parser Error Message: Could not load file or assembly 'Microsoft.Web.Services2, Version=2.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified (see http://forums.asp.net/1191544/ShowPost.aspx) I can't get around it!!! changing to Microsoft.web.services3 has the same error. Either I'm doing something wrong or VWDHosting doesn't support microsoft.web.services??? Did no one launch a web service with VWDHosting.net? ...

How to call a .net web service from another .net web service?
Hi all,I have developed two asp .net web services using visual studio .net 2003.I wish to call one web service from another web service.I tried adding a web reference of the web service in another web service and was able to do so.but i m not able to access the web methods provided by the web servicecould you please suggest a way to go about itExpecting quick replyThanxCharmy try to make sure that you reference it in the web reference and call it properly this is sample  [WebMethod()] public double CalcDistance(int x1, int y1, int x2, int y2) { Calculator.Service1 calc = new...

Web resources about - Please Help!! web parts and .net forms - asp.net.getting-started

Snapchat positions itself as breaking news platform with San Bernardino coverage
Snapchat is not typically a place you'd go to for information about a breaking news story. But the messaging app ran a story on the San Bernardino ...

Peter Jackson offers defense for Erdoğan insulter: 'That's not Gollum, that's Sméagol'
Lord of the Rings director Peter Jackson has volunteered evidence for a Turkish court case in which a doctor is accused of insulting President ...

Disney updates Star Wars: Commander with ‘The Force Awakens’ content
With just a couple of weeks to go before the highly anticipated theatrical release of Star Wars: The Force Awakens, Disney has gone full Force ...

Zuckerberg's huge pledge reflects a new era in philanthropy
The huge philanthropic pledge by Facebook CEO Mark Zuckerberg and his wife—totaling perhaps $45 billion—reflects the fast-paced emergence of ...

Conservatives In Congress Vote To Deny Climate Change
Earlier we mentioned that the House voted to authorize unconstitutional domestic spying on American citizens yesterday. The day didn't get any ...

'American Horror Story: Hotel' finally unmasks the Ten Commandments Killer
Warning: Spoilers ahead The Ten Commandments Killer has been revealed, at long last ... and it's exactly who we thought it was all along. There's ...

Yahoo To Sell Core Business? Board Explores Sale Of Internet Assets
Yahoo Inc. will consider selling the company’s core internet business, with the possibilities being discussed in a series of board meetings being ...

Microsoft Has A Holiday Serenade For Its Apple Store Rivals
If Microsoft can't have peace on Earth, maybe at least peace with Apple will do. Microsoft's newest holiday ad , set to air on TV on Thursday, ...

Google refute’s EFF’s “spying on students” allegations
This is quickly going to be a he/she said, he/she said case. Google has naturally responded to privacy watchdog EFF's accusations that the search ...

Amid protests, some Syrian refugees find a home in Texas
DALLAS (AP) — On a sofa in their small apartment, Bashar al Jaddou's three children climb on his lap and speak in quick, soft Arabic as a photographer ...

Resources last updated: 12/3/2015 10:00:43 AM