Hi,
I have a DataGrid in my webpage. I want to display grid data when the page is first loaded or when its updated. But i want to show only today's data. i have i hidden text field that contains today's date. Kindly see the code below. I need to change the hard coded date with a string variable and that is today's date. Thanks
Jignesh KumarPosted Nov 24, 2022, 6:06 AM
You can use FilterParameters parameter,
https://www.aspsnippets.com/Articles/Pass-TextBox-Text-Value-as-Parameter-to-SqlDataSource-in-ASPNet.aspx
Ahmed KhalidPosted Nov 24, 2022, 5:41 AM
Thanks Kumar,
As said, I do have a select query in the datagrid footer and i have a fundtion that gets the current date and populates into a hidden textbox as shown below:
//gets and displays current day - today
txt_Taskdate.Text = DateTime.Today.ToString("MM/dd/yyyy");
// a working sql query but it has a hardcoded date
How do i repalce a hard coded date with a date in the text field?
Jignesh KumarPosted Nov 24, 2022, 5:22 AM
Hi ahemad Khalid,
Please refer this one,
https://stackoverflow.com/questions/18654218/how-to-pass-dynamic-value-in-sqldatasource