|
May posting this question to web development forum helps you !
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
hi..
all i m showing three columns in gridview from database.the columns names are
DemandFor,Demand,demandPostedOn.In the last column i have given a button name "Feedback".
On click of this button i want to redirect on "Feedback.aspx" page.I n this page i want to show the fields DemandFor and Demand in the textboxes.I have redirected the page on button click.
but i dont know how to get the values of that particular row in which the button was clicked.
can any body guide me or give me a sample code.thanks...
|
|
|
|
|
|
nagendrathecoder wrote: http://www.codeproject.com/KB/webforms/GridView_DropDownList.aspx
sry its working fine
plz check the above link once..
If It Helps Click It as Answer
|
|
|
|
|
|
When you are click on the button, on the RowCommand Event, use GridViewRow Class to hold the data for tat row. the pass it to next page either using session or query string.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
hiii...
i got it sir.thanks sir....
Regards
parikshit
|
|
|
|
|
welcome sir
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Hi,
I have a page which refresh every 3 - 5 seconds, i gave refresh in meta tag. While refreshing, as normal all the controls are dissapear and display a white page for some milliseconds. I need to block the controls from disappearing at the time of refresh. ie, the user should not understood that page is refreshing.
How can i do that
Thankyou
Ypki
|
|
|
|
|
What is use of refresh the whole page ? Do you want to update any particular section or value on your page ? Then why you are not looking into AJAX Update Panel and AJAX Timer control to refresh the particular section, rather than Refreshing whole page.
Thank You !
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
The whole page contain a dynamically created html table with number of cell, in each there will be a value, these values will change frequently. Thats why i am refreshing the whole page.The page contain only that html table.
In AJAX Update Panel also the controls will dissapear for some milli seconds..ryt??
|
|
|
|
|
Use AJAX based solution.
Say you load the page within a div.
During refresh, make an AJAX request which will get the latest data and show in the div.
To know how to do an AJAX request follow :
http://www.w3schools.com/Ajax/Default.Asp[^] tutorial.
|
|
|
|
|
Hi,
I am installed Visual studio 2008 team player in my system.I have to run MS Petshop web application on my system but whenever I am opening my project from VS 2008 and executing it,I am encountering an exception.If I installed petshop's just source code,it throws exception as system.typeinitialization exception. and if I am installing petshop completely ,it throws system.reflection.targetinvocation exception.Please help me solve this error.
Thanks!
|
|
|
|
|
If I'm having a form with n textboxs (n defined by te user by pressing a "new registry" button for example), and the textboxs are named product1, product2, ...productn..
How should I retrieve the data in the POST?
Should I send n thrue the form too?
What is the typical way of doing this kind of forms??.. that there is a main record in a db (for example some headers) and n records within that record? is there a good practice way?
The db would look like
table1: mainid, headers
table2: id, mainid, etc.
(ie. one to many relationship)
|
|
|
|
|
Quake2Player wrote: If I'm having a form with n textboxs (n defined by te user by pressing a "new registry" button for example), and the textboxs are named product1, product2, ...productn..
I guess you are creating dynamic textbox on Button Click.
The control which you are creating dynamically, you need to created before Page_Load() , other wise, it will not able to maintain the View State Data or will not load the Postback Data.
If you deeply look inside ASP.NET Page Life Cycle, Before Page_Load(), there are two different methods calls. 1) LoadViewState() and 2)LoadPostbackData() .
So, if you create any control on Page_Load() , or after that it will not able to load the data.
So you need to create such control either in Pre_Init() or Init() method.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
That also applies for ASP.NET MVC? Which isnt that event oriented as pure ASP.net?
Anyway, is it ok the way im describing? To retrieve "n" and based on that retrieve the inputs.. or is there something like a container where i can do like "for each control in container" ?
|
|
|
|
|
my project is running locally fine. But when i upload it shows below error
[ArgumentNullException: Value cannot be null.
Parameter name: type]
System.Activator.CreateInstance(Type type, Boolean nonPublic) +7465206
System.Web.Profile.ProfileBase.CreateMyInstance(String username, Boolean isAuthenticated) +79
System.Web.Profile.ProfileBase.Create(String username, Boolean isAuthenticated) +231
System.Web.HttpContext.get_Profile() +107
ProductsAccordingCat.get_Profile() +49
ProductsAccordingCat.gotoCart(Object sender, EventArgs e) in ProductsAccordingCat.aspx.cs:696
System.Web.UI.ImageClickEventHandler.Invoke(Object sender, ImageClickEventArgs e) +0
System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +108
System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +118
System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
Please help me to solve this problem.
below is code
protected void gotoCart(object sender, EventArgs e)
{
ImageButton btn = (ImageButton)sender;
double Price = double.Parse(((Label)btn.Parent.FindControl("Price")).Text);//.Substring(8));
string ProductName = ((HyperLink)btn.Parent.FindControl("hlnkProductName")).Text;
string ImagePath = ((System.Web.UI.WebControls.Image)btn.Parent.FindControl("imgProduct")).ImageUrl;
string ProductID1 = ((HtmlInputHidden)btn.Parent.FindControl("hdnid")).Value;
string ParentID = ((HtmlInputHidden)btn.Parent.FindControl("hdnParentID")).Value;
int ProductID = Convert.ToInt32(ProductID1.Substring(1));
if (Profile.Cart == null) // here at this line it shows error
{
Profile.Cart = new shopping.ShoppingCart();
}
Profile.Cart.Insert(ProductID, Price,0, 1, ProductName, ImagePath);
Response.Redirect(ResolveUrl("~") + "Shopping_Cart/ShoppingCart.aspx");
}
modified on Tuesday, September 22, 2009 12:52 PM
|
|
|
|
|
Can you show us the code where it is breaking down? The stack helps, but not that much.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
below is code
protected void gotoCart(object sender, EventArgs e)
{
ImageButton btn = (ImageButton)sender;
double Price = double.Parse(((Label)btn.Parent.FindControl("Price")).Text);//.Substring(8));
string ProductName = ((HyperLink)btn.Parent.FindControl("hlnkProductName")).Text;
string ImagePath = ((System.Web.UI.WebControls.Image)btn.Parent.FindControl("imgProduct")).ImageUrl;
string ProductID1 = ((HtmlInputHidden)btn.Parent.FindControl("hdnid")).Value;
string ParentID = ((HtmlInputHidden)btn.Parent.FindControl("hdnParentID")).Value;
int ProductID = Convert.ToInt32(ProductID1.Substring(1));
if (Profile.Cart == null) // here at this line it shows error
{
Profile.Cart = new shopping.ShoppingCart();
}
Profile.Cart.Insert(ProductID, Price,0, 1, ProductName, ImagePath);
Response.Redirect(ResolveUrl("~") + "Shopping_Cart/ShoppingCart.aspx");
}
|
|
|
|
|
I would be interested to know if you ever found a solution. I too have recently come across this very same issue when trying to access the Profile object. I dont think it is related to this article some configuration issue on the server - look up MOSS and profile null.
|
|
|
|
|
While try to execute this code i get an error message " Invalid attempt to call Read when reader is closed."
Public Shared Function GetLMSSettings() As Hashtable
Dim h As Hashtable
h = CType(DataCache.GetCache("GetLMSSettings"), Hashtable)
If h Is Nothing Then
h = New Hashtable
Dim dr As IDataReader = SqlDataProvider.GetLMSSettings
While dr.Read()
If Not dr.IsDBNull(1) Then
h.Add(dr.GetString(0), dr.GetString(1))
Else
h.Add(dr.GetString(0), "")
End If
End While
dr.Close()
DataCache.SetCache("GetLMSSettings", h)
End If
Return h
End Function
|
|
|
|
|
befor below line you must check dr is nothing
While dr.Read()
|
|
|
|
|
c# .net 2.0 web application.
I have tried following code.It is working fine in Server box (I have created vitrual direcory for record folder in c: drive "),
but it not working in client box.
c:\\record\\record.wav"
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.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Microsoft.VisualBasic.Devices;
using Microsoft.VisualBasic;
using System.Runtime.InteropServices;
public partial class Recording : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
[DllImport("winmm.dll", EntryPoint = "mciSendStringA", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
private static extern int mciSendString(string lpstrCommand, string lpstrReturnString, int uReturnLength, int hwndCallback);
protected void btnRecord_Click(object sender, EventArgs e)
{
mciSendString("open new Type waveaudio Alias recsound", "", 0, 0);
mciSendString("record recsound", "", 0, 0);
}
protected void btnSaveStop_Click(object sender, EventArgs e)
{
mciSendString("save recsound c:\\record\\record.wav", "", 0, 0);
mciSendString("close recsound ", "", 0, 0);
Computer c = new Computer(); c.Audio.Stop();
}
protected void btnRead_Click(object sender, EventArgs e)
{
Computer computer = new Computer();
computer.Audio.Play("c:\\record\\record.wav", AudioPlayMode.Background);
}
}
Thanks,
Bruze
|
|
|
|
|
This is the basics of ASP.NET. If you play audio using Computer.Audio.Play it will always run in the server.
What you have to do is to download the wav file to the client and then invoke the browser media object installed to run your wav file.
For simplicity you can also use
Body BgSound ="~/record.wav"
I recommend to read basic books before you do programming in Web Environment, as there is some problems in the basics of this environment. Hope you understand.
Also on your problem if you are using BgSound or anything, always refer to the Virtual path, as Physical path of your server is different from the clients.
|
|
|
|
|
Thanks For Your Reply.
Actually, First of all I want to record the audio and Save into Client box using browser.Once I recorded the audio file then Upload into Server folder.
Thanks,
Bruze
modified on Monday, September 21, 2009 5:29 PM
|
|
|
|