|
Hello everyone,
I have created a custom webcontrol that extends from the repeater class and that uses a custom ControlBuilder class for parsing child elements. This is done so that each column in the list can be defined seperately within the .aspx page
Example:
<WebControls:CJIINList runat="server" ID="lstAreaAssignment">
<ListColumn header="Area Designation" datafield="area" type="link" action="ViewDetails.aspx?DocID={0}" actiondata="DocID" />
<ListColumn header="Shift" datafield="shift" type="dropdown" actiondata="1,2,3" />
etc...
</WebControls:CJIINList>
I was able to get this to work, but in the Visual Studio designer, the child elements are all tagged with the following error message:
Validation (XHTML 1.0 Transitional): Element 'listcolumn' is not supported
Is there any way to fix this? Also, I would like intellisense to pop-up the list of properties / attributes available to the ListColumn class like it does for the CJIINList webcontrol.
Any ideas / suggestions would be greatly appreciated...
Thanks!
|
|
|
|
|
I have done a Tab Approach in ASP.net with the help of javascript...
I have two tabs in my process..
On load Tab one is loaded.When i goto second tab its also loading finely.But
i click the submit button in tab2 it will redirect to first tab.
I have attached the image link here..
And also i have attached the file.....
http://img155.imagevenue.com/loc912/th_45113_Tab_02_122_912lo.JPG
http://img144.imagevenue.com/loc953/th_45110_Tab_01_122_953lo.JPG
Download the Code using this Link...
http://www.kirupa.com/forum/attachment.php?attachmentid=42974&d=1182316293
Plz Anybody...
Gnanavel
|
|
|
|
|
We need to see code, not screenshots.
How does your page store what tab is selected ? From what you've said, it doesn't sound like it does. If you add an asp:Hidden field in your page, you can store state info there, and viewstate will persist it between postbacks, just read it back in your javascript
Try writing more meaningful subjects, if you could, it really helps us to help you.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
<title>Tab
function frmSubmit() {
if( (document.get_quote.query.value).replace(/^\s+/g,'').replace(/\s+$/g,'')!="" && (document.get_quote.query.value).replace('Company name / code, MF name','')!="")
document.get_quote.submit();
}
.f10 {FONT-FAMILY: arial; FONT-SIZE: 10px;}
.f11 {FONT-FAMILY: arial; FONT-SIZE: 11px;}
.f12 {FONT-FAMILY: arial; FONT-SIZE: 12px;}
.headback {background:#6592CE;
filter:progid:DXImageTransform.Microsoft.Gradient(GradientType ,StartColorStr:'#6592CE',EndColorStr:'#114EA0');color:#FFFFFF;cursor:pointer;cursor:hand;}
.headbacksel {background:#ffffff;color:#000000;border:solid 1px #b5d6ef;cursor:text;border-bottom:none;}
| |
|
<asp:button id="btn_sam" text="Submit" runat="server" onclick="btn_sam_Click">
| |
|
|
I attach the Code above please give a solution for me...
If you find any mistake in my subject please apology me...
The Problem is when i click the submit button in tab2 i will postback to tab1.
And i want to write some other submit action for the button.And i want to stay in the same...What can i do.
Give a clear solution for me....
Gnanavel
UI Desinger
P2softech
|
|
|
|
|
Hi Friends,
I have problem sending mail through ASP.Net.
whenever i try to send the mail from my server for which i have passed the details like smtp server and from address , i get an error that :
Mailbox unavailable. The server response was: <myemail@gmail.com> No such user here
But i have specified the from email address of my smtp server.
I have no clue that why is it searching for a gmail address on the smtp server.
I hope i am able to state my question/problem.
Thanks in advance.
Deepak Surana
|
|
|
|
|
What makes you think it's searching for gmail ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I was debugging the code and after the send mail function it throws an exception.
This is where i got to know it is searching for the other address
Deepak Surana
|
|
|
|
|
hi friends
i should do server side validation on two controls
by making use of if condition in aps.net 1.1
i should not use any validation controls instead i should make use of
if..else condition for performing validation..
i have a textbox and a drop down list box..
text box has new entry
dropdown list box has selected items present in it
now i should write the coding for validating as such user
can enter new one or can select one...
please suggest me the solution for this
regards,
gayathri
--------------------------------------------------------------------------------
|
|
|
|
|
Sounds like homework to me. What have you tried so far?
only two letters away from being an asset
|
|
|
|
|
I have a script that I can post to via a simple html form, but I can't figure out how to replicate the results with HttpWebRequest. Is there a way of getting the full functionality of a form submit via the HttpWebRequest?
Works:
Does not Work:
ASCIIEncoding encoder = new ASCIIEncoding();
string ifxLoc = "http://script-to-submit-to/login.dll?login";
string postData = "UserName=" + unme;
postData += "&PassWord=" + upswd;
byte[] data = encoder.GetBytes(postData);
HttpWebRequest s2oReq = (HttpWebRequest) WebRequest.Create(ifxLoc);
s2oReq.Method = "POST";
s2oReq.AllowAutoRedirect = true;
s2oReq.ContentType = "application/x-www-form-urlencoded";
s2oReq.ContentLength = data.Length;
Stream s2oStream = s2oReq.GetRequestStream();
s2oStream.Write(data, 0, data.Length);
s2oStream.Close();
Problem:
The HttpWebRequest seems to make a shallow connection to the login.dll, or doesn't fully follow through. I can't get it...working... in any way. It just returns the input of the html of the login page. Am I going about it in the wrong manner?
I also need a way to impliment the native redirect that's built into the simple form submit. If I use a response.redirect() after closing the stream, it is not the same.
Thanks!
-Roo
|
|
|
|
|
Hi,
I have the Gridview which is bound to DataTable. In the GridView I have one button Delete for each row , when clicking on button the row need to be deleted from gridview.
private void BindGrid()
{
GridView1.DataSource = GetDataSource();
GridView1.DataBind();
}
protected System.Data.DataTable GetDataSource()
{
// const string key = "MyDataSource";
System.Data.DataTable aTable = new System.Data.DataTable();
aTable = (System.Data.DataTable)Session["dta"] ;
if (aTable == null)
{
aTable = CreateDataTableA(); -- In this CreateTable I am creating one DataTable and returning it.
Session["dta"] = aTable;
}
return aTable;
}
protected void GridView1_RowDeleting(object sender,GridViewDeleteEventArgs e)
{
int id = Convert.ToInt32( (GridView1.Rows[e.RowIndex].Cells[0].Text.ToString())); -- This statement containg null value always. This is giving exception because of this Null value.
FindRowByID(id).Delete();
BindGrid();
}
private DataRow FindRowByID(int id)
{
DataRow[] rows = GetDataSource().Select("District_ID = " + id.ToString());
return rows[0];
}
How to get the row’s cell value when delete button is clicked.
My Gridview syntax is like this:
<asp:gridview id="GridView1" runat="server" autogeneratecolumns="False" onrowdeleting="GridView1_RowDeleting">
<columns>
<asp:templatefield headertext="District_ID">
<edititemtemplate>
<asp:textbox id="TextBox1" runat="server">
<itemtemplate>
<asp:label id="Label1" runat="server" text="<%# DataBinder.Eval(Container.DataItem, "District_ID") %>" width="115px">
<asp:templatefield headertext="District_Name">
<edititemtemplate>
<asp:textbox id="TextBox2" runat="server">
<itemtemplate>
<asp:label id="Label2" runat="server" text="<%# DataBinder.Eval(Container.DataItem, "District_Name") %>">
<asp:commandfield buttontype="Button" deletetext="-" showdeletebutton="True" showheader="True">
Thanks in advance.
-- modified at 11:32 Wednesday 27th June, 2007
|
|
|
|
|
I suggest using an ObjectDataSource as an mediator between the GridView and the DataTable.
ObjectDataSource makes deleting, inserting, updating much easier.
Please read about using the ObjectDataSource an MSDN.
There are also quite a lot samples you can find using google (search terms: GridView ObjectDataSource)
Good luck
Urs
-^-^-^-^-^-
no risk no funk
|
|
|
|
|
I have a site where a user can input the first part of their post code to see if deliveries can be made to their area. Deliveries are only available in one area, so I use the following code:
Private Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click<br />
<br />
Dim al As New ArrayList()<br />
Dim i As Integer<br />
<br />
For i = 1 To 32<br />
al.Add("BS" & i)<br />
Next i<br />
<br />
Dim postCode = Me.txtPostCode.Text<br />
<br />
Dim idx As Integer = al.BinarySearch(postCode, New CaseInsensitiveComparer())<br />
<br />
If idx > 0 - 1 Then<br />
Me.litMsg.Text = "We can collect from you"<br />
Else<br />
Me.litMsg.Text = "We do not collect from your area"<br />
End If<br />
<br />
End Sub
This finds the first postcode, but none of the others. Is there something wrong in the code? Should I just use a database table and pull values from there instead?
Damian
|
|
|
|
|
Couldn't you use the following if you're only supporting one delivery area:
<br />
<br />
string str = txtPostcode.text;<br />
if (str.StartsWith ("BS"))<br />
...<br />
else<br />
...<br />
"Knock me down, I'll get straight back up again, I'll come back stronger than a powered up pacman"
(Lilly Allen / Kaiser Chiefs)
|
|
|
|
|
Hi Richard, thanks for responding.
I could use the StartsWith method (which works), However, the postcodes range from BS1 to BS32. So if a user types 'BS43' they still get the 'We can collect from you' message.
Any thoughts?
Damian
|
|
|
|
|
Put all valid postcodes into an List<string> and use the Contains method:
List<string> postalcodes = new List<string>();
// add all codes
postalcodes.Add("BS1");
...
if (postalcodes.Contains(TextBox.Text))
...
else
...
-^-^-^-^-^-
no risk no funk
|
|
|
|
|
Yeah - what he said lol...
"Knock me down, I'll get straight back up again, I'll come back stronger than a powered up pacman"
(Lilly Allen / Kaiser Chiefs)
|
|
|
|
|
I want to give facility of no. of hites in my site.
If any one have some idea about this.
please give me some source code.
Thanks,
Pathak
|
|
|
|
|
You can store this in a file or in the database. Store a number, have code that increments the number called when a page is being served.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
|
Hi Allm
I have created a MaskedTextBox UserControl with a number of properties (Value, MinValue, MaxValue etc.) The UserControl works but I am not able to actually get the Value from the UserControl in the main apsx page. In short what I have done:
UserControl with a TextBox, a RangeValidator and some JavaScript to take care of the formatting.
In the main page:
<uc1:MaskedTextBox ID="MaskedTextBox2" runat="server" MinValue="-10000" MaxValue="10000" ErrorMessage="Value must be between {0} and {1}" Required="true" Display="None" /><br />
<br /><br />
<asp:Button ID="Button1" runat="server" Text="Button" /></div><br />
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label><br />
And in the code behind on_load event:
<br />
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
if (Page.IsPostBack)<br />
{<br />
Label2.Text = MaskedTextBox2.TextValue.ToString();<br />
}<br />
}<br />
But the value of the TextValue property is not available because the UserControl is loaded after the Page_Load event. How do I get the TextValue of the UserControl in the PostBack of the aspx page?
I would prefer not to use Session or ViewState because I would like to use the UserControl as I would use a 'normal' TextBox. Any ideas out there?
Kind regards,
Mike
|
|
|
|
|
Woops sorry for the double post
Mike
|
|
|
|
|
If you want to do this I would suggest using an event
In your class
Public Event TextChanged(byval sender as object, byval e as eventargs)
Then pick up the text changed and bubble it
Public Sub textbox1_TextChanged(byval sender as object, byval e as eventargs) handles textbox1.textchanged
raiseevent textchanged(me, e)
end sub
Then you can use the event as normal within your aspx page.
If you need clarification please let me know
|
|
|
|
|
Thanks for the reply.
I'll try you solution. It looks somewhat better than the the solution I came up with my self. I try to dig in to the UserControl to get the value like this;
Label1.Text = (MaskedTextBox1.Controls[2] as TextBox).Text;
But working with events seems to be a more proper way.
Thanks,
Mike
|
|
|
|
|
What is causing the postback? I assume the Button.
Put your code in the event handler of the postback initiator instead of the load event handler. That would then be the Button_Click event handler if my assumption is right.
Happy Programming
Urs
-^-^-^-^-^-
no risk no funk
|
|
|
|