|
GoAzure wrote: Learn Windows Azure at your own pace
How someone is going to learn anything about azure in 1 week, at their own pace ?
|
|
|
|
|
There are rumors that there will be additional Azure Boot Camps in the near future so if you need more time to learn then get another free token from a future Boot Camp.
|
|
|
|
|
Free Windows Azure pass via Virtual Boot Camp III starting May 3rd
After the huge success of the Windows Azure Virtual Boot Camp I and II, here comes…
Virtual Boot Camp III Learn Windows Azure at your own pace, in your own time and without travel headaches.
Windows Azure one week pass is provided so you can put Windows Azure and SQL Azure through their paces.
NO credit card required. You can start the Boot Camp any time during May 3rd and May 10th and work at your own pace.
The Windows Azure virtual boot camp pass is valid from 5am USA PST May 3rd through 6pm USA PST May 10th
More information at http://blogs.technet.com/webtech/archive/2010/04/26/windows-azure-one-week-virtual-boot-camp.aspx
modified on Monday, May 3, 2010 6:22 PM
|
|
|
|
|
Hello,
I have written a page that accepts new information and then repopulates the page when a button is clicked. This is a simple task in C#, but seems very complicated in ASP.net. The code seems to work fine on the first click, but the after the first click, the page no longer repopulates. Closer examination reveals that although the values are changed on the page, the actual values held in memory remain the same; ergo, new results are the same as the old. Now...I see that on some controls (such as RadioButton) there is an automatic postback feature, however, I cannot find this for a button. Of course, I am presuming that the Postback is the problem....OR... perhaps it's something else? My preference is not to use javascript, but I of course will if that is the only way. I am still amazed that (after all this time) ASP still has to rely on Javascript for certain features. Any ideas both welcomed and appreciated.
Thank You, Pat
|
|
|
|
|
Show us your Page_Load function.
|
|
|
|
|
Dave,
Thank you for your reply. I have pasted the Page_Load info below. This page is brought up from a click event on another page's GridView and is supposed to populate information accordingly.
protected void Page_Load(object sender, EventArgs e)
{
medDate = CreateMedicalDate(medDate);
id = Request.QueryString["Id"];
Screening_Number = Request.QueryString["Screening_Number"];
Site_Number = Request.QueryString["Site_Number"];
Version_Id = Request.QueryString["Version_Id"];
Version = Request.QueryString["Version"];
AE = Request.QueryString["Ae"];
Serious = Request.QueryString["Serious"];
GetLastVersion();
SqlConnection Conn = new SqlConnection(CONNSTR);
try
{
string Sql = "SELECT [Id],[Period] , [Screening_Number] , [Site_Number] , " +
"[Version_Id],[Version] , [Ae] , [Frequency] , [Visit] , [VisitNumber] , [Date_Onset] , " +
"[Ongoing] , [Date_Ended] , [CTCAE] , [Serious] , [Related] , [Action] , [Outcome] , " +
"[NewConMedsY], [NewConMedsN], [SubBy] , [SubOn] , [Sae_Rpt_Status] " +
"FROM Adverse_Events WHERE [Version_Id] = @Version_Id AND [Version] = @LastVersion ";
SqlCommand Comm = new SqlCommand(Sql, Conn);
Comm.CommandType = CommandType.Text;
Comm.Parameters.Clear();
Comm.Parameters.AddWithValue("@Version_Id", Version_Id);
Comm.Parameters.AddWithValue("@LastVersion", lastCompletedVersion);
SqlDataAdapter da = new SqlDataAdapter(Comm);
DataSet ds = new DataSet();
da.Fill(ds);
LabelPeriod.Text = ds.Tables[0].Rows[0]["Period"].ToString();
LabelScreeningNumber.Text = ds.Tables[0].Rows[0]["Screening_Number"].ToString();
LabelVersion.Text = ds.Tables[0].Rows[0]["Version"].ToString();
LabelId.Text = ds.Tables[0].Rows[0]["Id"].ToString();
LabelAe.Text = ds.Tables[0].Rows[0]["Ae"].ToString();
LabelFrequency.Text = ds.Tables[0].Rows[0]["Frequency"].ToString();
LabelVisit.Text = ds.Tables[0].Rows[0]["Visit"].ToString();
LabelVisitNum.Text = ds.Tables[0].Rows[0]["VisitNumber"].ToString();
LabelDateStarted.Text = ds.Tables[0].Rows[0]["Date_Onset"].ToString();
LabelOngoing.Text = ds.Tables[0].Rows[0]["Ongoing"].ToString();
LabelDateStopped.Text = ds.Tables[0].Rows[0]["Date_Ended"].ToString();
LabelCtcae.Text = ds.Tables[0].Rows[0]["CTCAE"].ToString();
LabelSerious.Text = ds.Tables[0].Rows[0]["Serious"].ToString();
LabelRelated.Text = ds.Tables[0].Rows[0]["Related"].ToString();
LabelAction.Text = ds.Tables[0].Rows[0]["Action"].ToString();
LabelOutcome.Text = ds.Tables[0].Rows[0]["Outcome"].ToString();
RadioButtonConMedY.Checked = Convert.ToBoolean(ds.Tables[0].Rows[0]["NewConMedsY"].ToString());
RadioButtonConMedN.Checked = Convert.ToBoolean(ds.Tables[0].Rows[0]["NewConMedsN"].ToString());
LabelSubBy.Text = Session["Name"].ToString();
LabelSubOn.Text = medDate;
}
catch (Exception ex)
{
Console.WriteLine("Error : " + ex.Message);
}
SetDateDropdownBoxes();
}
There is a button on the page that is supposed to decrement a value in the LabelVersion label and re run the Sql thereby re populating the page with new information. As I said, it works on the first click, but not afterwards. Thanks for your attention. Best, Pat
|
|
|
|
|
And where is the button click event? Without checking for IsPostback all this will do is repopulate the controls from the database and overwrite the value you expect.
I would refactor this code to extract the all the SQL lookup code to a method so It can be called from multiple places in your code. Such as from the PageLoad event and from the button click handler
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Thank you for your help, Mark. Here is the full text:
//The Button Code
protected void ButtonGoBack_Click(object sender, EventArgs e)
{
LoadPreviousVersion();
}
//The Method Call
private void LoadPreviousVersion()
{
int requestedVersion = (int.Parse(LabelVersion.Text)) - 1;
if (requestedVersion < 1)
requestedVersion = 1;
LabelVersion.Text = requestedVersion.ToString();
if (int.Parse(LabelVersion.Text) != int.Parse(lastCompletedVersion))
ButtonEdit.Enabled = false;
else
ButtonEdit.Enabled = true;
medDate = CreateMedicalDate(medDate);
SqlConnection Conn = new SqlConnection(CONNSTR);
try
{
string Sql = "SELECT [Id],[Period] , [Screening_Number] , [Site_Number] , " +
"[Version_Id],[Version] , [Ae] , [Frequency] , [Visit] , [VisitNumber] , [Date_Onset] , " +
"[Ongoing] , [Date_Ended] , [CTCAE] , [Serious] , [Related] , [Action] , [Outcome] , " +
"[NewConMedsY], [NewConMedsN], [SubBy] , [SubOn] , [Sae_Rpt_Status] " +
"FROM Adverse_Events WHERE [Version_Id] = @Version_Id AND [Version] = @RequestedVersion ";
SqlCommand Comm = new SqlCommand(Sql, Conn);
Comm.CommandType = CommandType.Text;
Comm.Parameters.Clear();
Comm.Parameters.AddWithValue("@Version_Id", Version_Id);
Comm.Parameters.AddWithValue("@RequestedVersion", requestedVersion);
SqlDataAdapter da = new SqlDataAdapter(Comm);
DataSet ds = new DataSet();
da.Fill(ds);
LabelPeriod.Text = ds.Tables[0].Rows[0]["Period"].ToString();
LabelScreeningNumber.Text = ds.Tables[0].Rows[0]["Screening_Number"].ToString();
LabelVersion.Text = ds.Tables[0].Rows[0]["Version"].ToString();
LabelId.Text = ds.Tables[0].Rows[0]["Id"].ToString();
LabelAe.Text = ds.Tables[0].Rows[0]["Ae"].ToString();
LabelFrequency.Text = ds.Tables[0].Rows[0]["Frequency"].ToString();
LabelVisit.Text = ds.Tables[0].Rows[0]["Visit"].ToString();
LabelVisitNum.Text = ds.Tables[0].Rows[0]["VisitNumber"].ToString();
LabelDateStarted.Text = ds.Tables[0].Rows[0]["Date_Onset"].ToString();
LabelOngoing.Text = ds.Tables[0].Rows[0]["Ongoing"].ToString();
LabelDateStopped.Text = ds.Tables[0].Rows[0]["Date_Ended"].ToString();
LabelCtcae.Text = ds.Tables[0].Rows[0]["CTCAE"].ToString();
LabelSerious.Text = ds.Tables[0].Rows[0]["Serious"].ToString();
LabelRelated.Text = ds.Tables[0].Rows[0]["Related"].ToString();
LabelAction.Text = ds.Tables[0].Rows[0]["Action"].ToString();
LabelOutcome.Text = ds.Tables[0].Rows[0]["Outcome"].ToString();
RadioButtonConMedY.Checked = Convert.ToBoolean(ds.Tables[0].Rows[0]["NewConMedsY"].ToString());
RadioButtonConMedN.Checked = Convert.ToBoolean(ds.Tables[0].Rows[0]["NewConMedsN"].ToString());
LabelSubBy.Text = Session["Name"].ToString();
LabelSubOn.Text = medDate;
}
catch (Exception ex)
{
Console.WriteLine("Error : " + ex.Message);
}
}
|
|
|
|
|
I may be confused, both posts together are the code you are using correct? If so, then as I said, you need to use IsPostBack in the PageLoad event so the controls are not overwritten each time the page is loaded, i.e. during a postback caused by the button click. And again, abstract the database code to a separate method. It will save you a lot of typing and cut & paste errors and debugging.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Yes,Yes,Yes,Yes....OK....."I SEE" said the blind man. Both you and David were right Mark, and now I GET it. When the page re posts, it is running the load event all over again, and that is overwriting the method so it appears that it is unchanged. I am so sorry that I did not understand. You are both saying the same thing.....it took a moment for it to sink in. THANK YOU both very much. I scripted it a bit different, but it is working now. I will try to mark both answers correct, as they both are. If it is not allowed, I guess I will have to stamp Mark's first only since his was sent first. I greatly appreciate the time and skill from both of you, and I hope you will sign in for me again in the future. Best regards, Pat
|
|
|
|
|
PDTUM wrote: I have written a page that accepts new information and then repopulates the page when a button is clicked. This is a simple task in C#, but seems very complicated in ASP.net. The code seems to work fine on the first click, but the after the first click, the page no longer repopulates.
PDTUM wrote: This page is brought up from a click event on another page's GridView and is supposed to populate information accordingly.
Well I might be a little confused on exactly which is the first click.
But anyways what you need is code like this ...
protected void Page_Load(object sender, EventArgs e) {
if (Page.IsPostBack)
{
LabelVersion label gets deincremented here
}
medDate = CreateMedicalDate(medDate);
id = Request.QueryString["Id"];
Screening_Number = Request.QueryString["Screening_Number"];
Site_Number = Request.QueryString["Site_Number"];
and so on ...
|
|
|
|
|
Yes,Yes,Yes,Yes....OK....."I SEE" said the blind man. Both you and Mark were right David, and now I GET it. When the page re posts, it is running the load event all over again, and that is overwriting the method so it appears that it is unchanged. I am so sorry that I did not understand. You are both saying the same thing.....it took a moment for it to sink in. THANK YOU both very much. I scripted it a bit different, but it is working now. I will try to mark both answers correct, as they both are. If it is not allowed, I guess I will have to stamp Mark's first only since his was sent first. I greatly appreciate the time and skill from both of you, and I hope you will sign in for me again in the future. Best regards, Pat
|
|
|
|
|
hi, iam using asp.net with c#, with sql server 2000
in my gridview iam displaying data from view at page load event
the 1st column is checkbox in template field,2nd is categorynamee,3rd is itemkey, 4th is itemkeyname
5th is currentqty, 6th is salesprice,7th is quantity, 8th is total
i have to insert into two tables
1st table orders
orderno int primary key autoincrement,
username nvarchar(50) ,
shopname nvarchar(50),
email nvarchar(100)
2nd table is Orderdetails
serialno int primarykey autoincrement,
orderno int foreignkey,
categorynamee nvarchar(50),
itemkey nvarchar(50),
itemkeyname nvarchar(50),
currentqty decimal,
salesprice decimal,
quantity int,
total decimal
when user selects any no of the checkboxes that rows should be added in both tables, iam getting errors
can you give examples which helps me
|
|
|
|
|
So at the time of subit, Iterate throgh all the gridview rows and which row has checkbox checked, save it in database.You can save the data in both the table using query.
Where are you actually facing problem?
|
|
|
|
|
Easy, your code is wrong - what else do you expect it to be?
Without seeing your code or knowing what errors you are getting someone is meant to help you fix the problem. Can you see where the problem really lies?
Bob
Ashfield Consultants Ltd
|
|
|
|
|
What errors are you getting?
developerit wrote: can you give examples which helps me
Search google, you'll find many examples on this.
|
|
|
|
|
Hi,
I have the following problem:
Two custom controls, first control has a button, when I click this button I'd like to render the second custom control content in popup window. How to do it?
Please, help.
|
|
|
|
|
So what is the problem, have a page with second custom control and on button click open that page in popup. You can also use ajaxmodelpopupextender.
|
|
|
|
|
You can use the AjaxControlToolkit to perform this action.
|
|
|
|
|
I would like to call some methods at the very beginning of my web application. Also, I want to ensure that those methods are called only once per application lifetime, no matter what. What is the best way to accomplish this?
|
|
|
|
|
TRY THIS
protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack)
{
FillConatcsGrid();
CheckSessionId();
}
}
GoodLuck
|
|
|
|
|
This will not work as user may start my application from different page
|
|
|
|
|
If your methods are Application specific, and wiil be same for all then users then you can call your methopds from the function Application_Start of Global.asax file.
and if it user specific then you can call your methopds from the function Session_Start of Global.asax file.
|
|
|
|
|
Tnx, it was exactly what I asked for. Thank you
|
|
|
|
|
your welcome
|
|
|
|
|