Your also using 'NamaBarang' twice as an ID. ID parameters need to be unique.
BMXDad 23 Newbie Poster
Your also using 'NamaBarang' twice as an ID. ID parameters need to be unique.
Request.QueryString["Name"] will get you the query parameter named "Name".
If you need the name of the page:
string refPage = Request.UrlReferrer.ToString();
KodeBarang is a label so you'll need to make an instance of it first by locating it in the reapeater. Are you trying to find its value?
Line 31 should be at line 74
You closed the repeater, before adding the content.
Sorry for the late reply ...
You can call the handler.cs in the public method you use in the Result.aspx.cs. MakeText() is what you called it. Make sure its public, and then you can call your Handler.cs method.
Your code is showing a GridView, but its named a ListBox? Anyway, if you're using data keys this will get row and a key(s) which can be used to remove the particular selection. This is not like above, where its only removed from the grid, to be shown again on databind.
protected void btnDeleteFromListBox_Click(object sender, EventArgs e)
{
LinkButton lnkbtn = (LinkButton)sender;
// command argument from selected row
string id = lnkbtn.CommandArgument;
GridViewRow row = (GridViewRow)lnkbtn.NamingContainer;
// row selected
int gridRow = row.RowIndex;
DataKey key = GridView1.DataKeys[gridRow];
// data key 'Key' from selected row
string k = (string)key["Key"];
// For testing purpose. A method can be coded to do what ever to the record.
// RemoveSelection(k);
Response.Write("title: " + k + ", Id: " + id);
}
If your method is set to public it can write directly when called:
`public string MakeText()
{
string results;
// Add code here
return results;
}
This goes in aspx page, and will output what ever MakeText returns on page load.
<%= MakeText(); %>`
jQuery can do that for you too ...
$(document).ready(function() {
$('#txtBoxId').focus();
});
Just add a value to the "Text" attribute. If you need a dynamic entry you can set it from a public method.
<asp:TextBox ID="txtBox" Text="Default Value" runat="server" ></asp:TextBox>
Having the reference at the bottom will allow the page to render completely, before running any scripts that might need running. If I remember correctly, the page will stop rendering, if it encounters a script reference, to only continue when its been cached or ready to use. Something to think about when you have a script heavy page.
But for normal pages top or bottom will work fine.
In C#, this will loop throuh all controls and get their values ... you need to do something with it them though.
private void GetControlValues(Control parent)
{
foreach (Control c in parent.Controls)
{
if (c is DropDownList)
{
string ddlValue = ((DropDownList)(c)).SelectedValue;
}
if (c is TextBox)
{
string txtbox = ((TextBox)(c)).Text;
}
if (c is CheckBox)
{
bool value = ((CheckBox)(c)).Checked;
}
GetControlValues(c);
}
}
Add this just under the closing form tag, line 105
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
Post the full html ... minus any content of course.
Sorry ... what I sent is for a button click. This works like you want I think.
http://jsfiddle.net/GBL4s/1/
<label for="business">
<input type="checkbox" id="business">Business</label>
<div id="businesslist">
<ul style="list-style: none;">
<li>
<label for="chk1">
<input type="checkbox" name="chk1" id="chk1" class="sub" />First</label>
</li>
<li>
<label for="chk2">
<input type="checkbox" name="chk2" id="chk2" class="sub" />Second</label>
</li>
<li>
<label for="chk3">
<input type="checkbox" name="chk3" id="chk3" class="sub" />Third</label>
</li>
<li>
<label for="chk4">
<input type="checkbox" name="chk4" id="chk4" class="sub" />Fourth</label>
</li>
<li>
<label for="chk5">
<input type="checkbox" name="chk5" id="chk5" class="sub" />Fifth</label>
</li>
<li>
<label for="chk6">
<input type="checkbox" name="chk6" id="chk6" class="sub" />Sixth</label>
</li>
<li>
<label for="chk7">
<input type="checkbox" name="chk7" id="chk7" class="sub" />Seventh</label>
</li>
</ul>
</div>
$('#business:checkbox').change(function () {
if ($('#business:checkbox').attr("checked")) $('.sub').attr('checked', 'checked');
else $('.sub').removeAttr('checked');
});
You need a return value between the two curley brackets on line 18, like mentioned above.
Is there an id field in the table? if so, your SP can do the below.
select *
from TableName
where Id = (select max(Id) from TableName)
It would be easier to do it in jQuery.
$(function () {
$('#business').toggle(
function() {
$('#businesslist .subb').prop('checked', true);
},
function() {
$('#businesslist .sub').prop('checked', false);
}
);
});
To split the string at the dash, with string str being the returned result ...
string s = str.Substring(str.IndexOf("-")+1, str.Length - (str.IndexOf("-")+1));
Are you talking initial page load or after a post back? You can seperate post back and intial load by:
if(!IsPostBack)
{
First page load;
}
if(IsPostBack)
{
Any page postback, but not the intial one;
}
OK ... in the solution explorer right click on the project or site name. Click 'Add Reference". In the .Net tab, search for the System.Web.Service component then click it and click OK. This will add a new reference to the project. Rebuild and try it out.
Not saying this will work, but it's showing in the error that it's missing the reference, so good luck.
Is this a complied site?
Are you using Visual Studio? If so, what version.
Are the pages using code behind or inline?
Try adding a reference to System.Web.Services
I see ... Your going from .Net 1.1 to 2.0 ... sounds like a call has been depreciated.
Can you post the error?
What is TempDataStore?