how to pass query string on button click when data retrieve from database - webforms

I make a method for data retrieving from database. showing data in repeater using button inside repeater. I want to pass query string on button click with passing id.
if(e.CommandName=="detail")
{
Response.Redirect("cardetail.aspx?id=" +carid);
}
It's not working

Related

How to change oracle apex 5 item after dynamic action button clicked?

This is for Oracle Apex 5.
I have a static content item on my login page, it has registration fields with a dynamic action button. Upon the click of the button their details are inserted into a table. I'd like the fields to disappear and 'registered. email verification sent' text to appear in that static content?
If that's not possible, is there a way for me to write that text underneath the registration fields and at the same time, clear all the fields - after button click?
If I understood correctly you have a Static Content Region (not item) with some text as source and you want that text to change if so i suggest you add a Display Only Item inside the Static Content Region and in that Dynamic Action simply change the value of the item using pl/sql, javascript or Set Value Dynamic Action.
Edit: You can use this plugin to have a timer that will run a Dynamic Action to change the text.

How to send a data from a table to a form in codeigniter

I'm totally new to CI. I am working on the project that fetch data from a db and send it a particular data to a form on a click of a ADD button. Here is the screen shot of my table..enter image description here
Here is the screenshot of my form..
enter image description here
Your add button should collect the data it needs, send it to controller, and controller passes it to model so it can collect the data that you need by sql. Pass it back to controller and controller passes the data to the view ( your form . In your view you just put the data where ever you need.

AMChart handleClick to retrieve data from database based on item clicked

I'm using AMChart stacked chart to report test execution status from DB. Php file with query is feed into the dataLoader and the stacked columns displays Pass, Fail and NoRun count data for each category. I'm trying to use handleClick function to make the column clickable and once clicked, a query is fired to retrieve data specific to that column's Pass, Fail or NoRun count data and displays the data on the same page. I'm not sure how to implement this. Any help is greatly appreciated!
Below is all I have so far, clicking the column triggers an alert with name of the category and a count, my goal is to be able to trigger a php file with parameters passed in and display data from DB,
// add click listener
chart.addListener("clickGraphItem", handleClick);
function handleClick(event)
{
alert(event.item.category + ": " + event.item.values.value);
}
The issue has been resolved by using JSON (converted from DB data in PHP) and AJAX to display. Within handleClick I call another JS function and pass in the graph variables that the query inside PHP needs.

Select item in a gridview

I'm trying to create a webpage where a user can click on an item inside a gridview and have that rows data display in another page. I cannot figure out how to set it up so only the selected row's information is displayed in (I am thinking I will use a form view to display the data on the second page) the form view on the second page. Any suggestions?
Thanks!
Jake
If you have just a couple of columns i did suggest you to use QueryString to pass values between pages. Lets say there are two such values you want to pass to another page:
Response.Redirect("default2.aspx?firstvalue=" + yourfirstvalue + "&secondvalue=" + yoursecondvalue");
// this will set the values you want to pass on your gridview page
Request.QueryString("firstvalue")
// this will retrieve the first value from URL from your second page
If you want a neat lookin URL then i would suggest you to use Session variables.

how to use razor as user control

Example Scenario:
Let's say I need to create a user control which displays a list of products for specified category (CategoryID passed as input to Index GET controller).
Also, it has a "Add" button below list which calls Category Details (GET) controller (passing categoryID to controller) which displays a form with Text box and button to add new category.
Once user enters category Details and press submit, Details (POST) controller is called which saves data and should redirect user back to page from where it was called.
This user control (razor file) can be used multiple times on same page.
Queries
1) What is best approach to integrate such a control in page views such that form in every user control is self contained and doesn't conflicts with other instances of same user control in same page?
2) I tried Html.RenderAction("Index","Category",new {categoryName = "toys"})
This works well in displaying category and clicking on Add button does takes user to "Add a new category" page. Problem is, what code should I write such that I can take user back to the same view page, where the user control was embedded (even better if I can scroll window to the position where control was placed)?
thanks!
When Data is posted in a partial view to the corresponding Action , It has no context of the main view/action. So we can post data to the main action so that modelstate is preserved and can be validated.
But if you want to post data to the partial view/action, we can redirect to main view/action post product is added.(But if some invalid data is entered, we cannot display any validation error)
[HttpPost]
public PartialViewResult AddProduct(string productId,string returnUrl)
{
//Add product
return Redirect(returnUrl);
}
What you are looking for is a partial view, namely an editor template.
In your Views folder, create a Shared folder and inside that create an EditorTemplates folder. From there create a strongly typed partial view named the same as the part of the model.
Then on your main view call EditorFor.

Resources