|
How do you know there are six ? Have you tried finding info on the web ? Or in your course notes ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I'm not sure about the number six. Whatever the objects are present in ASP.Net, please let me know
|
|
|
|
|
I think you're getting confused. In classic ASP there were 5 objects available:
Request
Response
Server
Session
Application
In ASP.NET there are hundreds (if not thousands) - every object defined in the .NET runtime is available for use.
|
|
|
|
|
how to call back from server side
Piyush Vardhan Singh
p_vardhan14@rediffmail.com
http://holyschoolofvaranasi.blogspot.com
http://holytravelsofvaranasi.blogspot.com
|
|
|
|
|
I have no idea what you mean, but I'd guess that it's not possible. Your server side creates html which is sent to the client when the client requests it. The client side does not exist while the server side is running.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Soposed that i have two aspx page One have hash table and another page have data grid
when hash tabele add new data in table then it inform to another page u refresh ur grid
Piyush Vardhan Singh
p_vardhan14@rediffmail.com
http://holyschoolofvaranasi.blogspot.com
http://holytravelsofvaranasi.blogspot.com
|
|
|
|
|
Are both forms visible at once ? If so, then if they are not parent and child, I doubt you can do that, without polling using AJAX. If only one is visible at a time then the form will work out the new state for itself as it reloads.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi
In my webform(webform1.aspx), i have an iFrame control, along with with many web controls.
The "src" attribute of it refers to another webform.(webform2.aspx)
I want text to appear in the frame on clicking a button which fetches the
value from db. Am using a session variable to hold the text to be assigned for iframe.
And am using the following code in WebForm1.aspx
<br />
private void Button1_Click(object sender, System.EventArgs e)<br />
{<br />
Session["Cont"] = "This is a page";<br />
<br />
HtmlGenericControl frame1 = (HtmlGenericControl)this.FindControl("txtFrame");<br />
<br />
frame1.Attributes["src"] = "WebForm2.aspx"; <br />
<br />
Server.Execute("WebForm2.aspx");<br />
Response.ClearContent();<br />
}<br />
And in WebForm2.aspx,Page_Load(..)
<br />
if(Session["Cont"]!=null)<br />
{<br />
Literal1.Text = Session["Cont"].ToString();<br />
}<br />
The problem is when i click the button in WebForm1.aspx, along with actual text, a textbox with some characters is appearing in the iFrame though there's no other control in the target(Webform2.aspx) other than Literal control.
Please help me in finding out the actual problem and its solution.
Thanks
~VSree
|
|
|
|
|
Hi,
I have this code for my e-Commerce site (asp.net2 with C#) for adding items to Shopping Cart:
protected void btnAddToCart_Click(object sender, ImageClickEventArgs e)
{
string Price = double.Parse(((Label)DataList1.Controls[0].FindControl("PriceLabel")).Text).ToString("0.00");
string ProductName = ((Label)DataList1.Controls[0].FindControl("BookNameLabel")).Text;
string PictureURL = ((Label)DataList1.Controls[0].FindControl("picLabel")).Text;
int ProductID = Convert.ToInt32(Request.QueryString["idLabel"]);
if (Profile.cart == null)
{
Profile.cart = new ShopCart.myshoppingcart();
}
Profile.cart.Insert(ProductID,Convert.ToDouble(Price),1,ProductName,PictureURL);
Server.Transfer("ItemIndex.aspx");
}
but when i'm runnig my site and click on btnAddToCart
this error occur:
Object reference not set to an instance of an object.
i underlined my code where this error occur.
i search in google but i didn't get any result or i don't underestand what should i do?
how i can solve this error?
thank you,
Hoda
|
|
|
|
|
Saba02 wrote: string Price = double.Parse(((Label)DataList1.Controls[0].FindControl("PriceLabel")).Text).ToString("0.00");
Wow - what horrible code.
Try this:
if (DataList1.Controls.Length > 0)
{
Control c = DataList1.Controls[0];
Label l = c.FindControl("PriceLabel") as Label;
if (l != null)
{
string Price = l.Text;
Apart from the layers of code with no error checking, what on earth possesses you to do a double.Parse, then turn it back to a string ? If you want to make sure the value is a double, use double.TryParse, not a method that, if it fails, throws an exception.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
This is quite a general error message.
You will need to check that all code referenced in the c# is correct at time of processing:
i.e. dont refer to a control in c# which doesnt exist in aspx page
For example you could be finding a control that doesnt exist or
Saba02 wrote: QueryString["idLabel"]);
the above might not exist or be transferring
Can you post your aspx?
|
|
|
|
|
Hello all,
In a data table in am getting number of rows present is dataset returned by query.If my datatable contain 15 rows the i want to remove last 5 rows.I need only 10 rows in datatable and bind that rows to datalist.
So how can i remove additional rows (more than 10) from data table.
<br />
QuestionCount =0<br />
QuestionCount = QuestionCount + questionDs.Tables(0)<br />
Please help me.
People Laugh on me Because i am Different but i Laugh on them
Because they all are same.
|
|
|
|
|
The most logical way to do this, is to do it in the data layer.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Can u tell me how can i do this using data layer?
People Laugh on me Because i am Different but i Laugh on them
Because they all are same.
|
|
|
|
|
By only requesting the rows you want to display, for example, select top 10 * from blah
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I cant use select top 10 because of my requirment.
Because i am retrieving question accordingly to element id. If element 1 contain 15 question then i want to display only 10 question on a page. If it contain 5 question then i am retrieving question using next element id. If element 2 contain 10 question then i need to display 5 remenign question
from first element and 5 question from element 2 on next page.Next 5 question from element 2 need to bind to seprate data list.
I need to bind question from each element to seprate data list.
People Laugh on me Because i am Different but i Laugh on them
Because they all are same.
|
|
|
|
|
Why not use a filter in the datatable ? like "Select top 10 .." Or you may even consider using it in the actualy SQL query that you use to retrieve rows from DB.
OK,. what country just started work for the day ? The ASP.NET forum is flooded with retarded questions. -Christian Graus
Best wishes to Rexx[^]
|
|
|
|
|
How can u use filter to data table? I cant use top 10 query because accordingly to requirment i am getting question for each element. If first element contain 2 rows or rows less than 10 then i am binding that to datalist if it contain less than 10 and element 2 conatin 15 rows i want to display remening rows in next datailst. (if element1 conatin 3 rows then
i want to bind only remening 7 rows to second data list.I want to display only 10 record on a page)
So i am checking the condition if element 1 contain rows lessthan equal toor greater than 10.
Please tell me how can i do this.
People Laugh on me Because i am Different but i Laugh on them
Because they all are same.
|
|
|
|
|
Why do you need all the questions if you're not going to show them all ?
Sounds like you need to set up paging in your data layer.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I cant use paging because on each page once all questioin get displayed i need to display "Finish" button on last page. When he click on Finish then he can see all the summery of his survey and if he wish then before submitting survey he can change his answer by usnig previous link by which in on last page.
People Laugh on me Because i am Different but i Laugh on them
Because they all are same.
|
|
|
|
|
Perhaps you need only one datagrid then, to show all the questions ? Why do you have two ? Are they on different pages ?
I think you need to keep your previous answers in the session, or in viewstate, as you keep going back to the same page but showing a different page of questions.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I need two data grid because i want to show element name before displaying question in that element. In following fashion.
Element 1
- Question 1
- Question 2
- Question 3
- Question 4
Element 2
- Question 1
- Question 2
- Question 3
in that fashion. At the end of page <next> Link. On next page next question in the same element or any other element. In that ways. Admin can add any number of element in a selected category and any number of question in selected element. When user taken any survey he must see all the question followed by element name before displaying question in that element.
People Laugh on me Because i am Different but i Laugh on them
Because they all are same.
|
|
|
|
|
I would render the list of questions with nested repeaters. And, like I said, I would use the same page over and over to render questions and then use viewstate to store all the answers given so far.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi
I am using google search box on my intranet which is in an internal network.
I cannot seem to get it to work though is this because google search only works on a website and not an internal intranet.
any help would be great
thanks!
|
|
|
|
|
Google does not index your internal site, so why would it be able to search it ? If you don't expose it to the web, then google is not indexing it, simple as that.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|