|
Sir;
You said:
when certain condition hold true, it triggers the textarea to be visible.
Please elaborate or show me your code.
Help people,so poeple can help you.
|
|
|
|
|
Thank you for all your help!
This web application is written in C#, I should have specified that. So, the small and big "V" would not have been an issue.
Also, "InnerText" is a property of of the textarea. Not Javascript.
Solved this problem by using an asp:Literal tag.
Thank you!
|
|
|
|
|
so, your problem was that the tag
<textarea id="TextBox1" runat="server" ></textarea>
generates an object of type HTMLGenericControl.
when the page is first loaded, the server want mention the control in the response if TextBox1.Visible is set to false, nor in the viewstate. So, when the TextBox1.Visible is set again to true on the button click request the server wont load TextBox1's properties of TextBox1 from the request so they need to be set again.
Help people,so poeple can help you.
|
|
|
|
|
Hi all,
m having problem with the following code:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim a As New DataSet1.TasksDataTable()
Dim adp As New DataSet1TableAdapters.TasksTableAdapter
adp.Fill(a)
GridView1.DataSource = a
GridView1.DataBind()
GridView1.Visible = True
End Sub
I created a dataset in visual studio by drag n drop. It has got two tables: Tasks and Reply. I saved the dataset by name Dataset1.xsd.
The problem is that the gridview doesn't show up at all. without throwing any errors.
please help.
|
|
|
|
|
Resolved! In GridView
it was AutoGenerateColumns="False"
I changed it to AutoGenerateColumns="True"
.........
Silly Mistake!
|
|
|
|
|
Hello All,
I'm try to show images from database in a client side, but, I have been using many kinds of examples that I found and none work, none of the images shown. The last example I saw it's this:
Auto-bind byte[] to asp:Image[^]
I understand perfectly the example, but the images are still not displayed.
Someone help me a bit with this issue?
In summary, I'm use a HTML5 drag & drop files. Send the files via XMLHttpRequest in a FormData object. One handler take this files in byte() and store in SQL DataBase.
Client code:
$("#btnUploadFile").click(function () {
if (files.length <= 0) {
alert("Debe seleccionar algún fichero para subirlo.");
} else {
var expID = $("#ContentPlaceHolder1_hfExpId").val();
var formData = new FormData();
for (var i = 0; i < files.length; i++) {
alert(files[i].name);
formData.append('file', files[i]);
}
var xhr = new XMLHttpRequest();
xhr.open('POST', "FileHandler.ashx", true);
xhr.overrideMimeType('text/plain; charset=x-user-defined-binary');
xhr.setRequestHeader("ExpedienteID", expID);
xhr.onload = function () {
if (xhr.status === 200) {
RefreshFilePanel();
} else {
console.log('Something went terribly wrong...');
}
};
xhr.send(formData);
};
Handle code:
Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
Dim documentBytes As Byte()
Dim lExpId As String = context.Request.Headers("ExpedienteID")
Dim fLenght As Integer
If (context.Request.Files.Count > 0) Then
Dim files As HttpFileCollection = context.Request.Files
For i = 0 To files.Count - 1
fLenght = files(i).ContentLength
documentBytes = New Byte(fLenght - 1) {}
context.Request.InputStream.Read(documentBytes, 0, fLenght)
UploadDocumentBy_ExpID(documentBytes, files(i).FileName, "Description" & lExpId.ToString, lExpId)
Next
End If
End Sub
More late, I try to put this byte() in a image tag on grid.
aspx code:
<asp:GridView ID="grdDocumentoByExp" runat="server" AutoGenerateColumns="false" Width="250px"
DataSourceID="dtsDocumentByExpId">
<Columns>
<asp:BoundField DataField="Archivo" HeaderText="Archivo" />
<asp:BoundField DataField="docId" HeaderText="docId" />
<asp:BoundField DataField="Documento" HeaderText="Documento" Visible="false" />
<asp:TemplateField HeaderText="Preview">
<ItemTemplate>
<asp:Image
ID="imgThumb"
runat="server"
ImageUrl='<%# GetImage(Eval("Documento")) %>'
/>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
And the function GetImage in codebehind:
Public Function GetImage(image As Object) As String
Return "data:image/gif;base64," & Convert.ToBase64String(DirectCast(image, [Byte]()))
End Function
In all steps, there is no error, but I think that the error is posible located in the byte() file format..but i'm not sure.
Someone help me?
Sorry for my inglish and Thanks.
|
|
|
|
|
does your image really have the content type of 'image/gif'? (in other words does it have the extension .gif? )
Help people,so poeple can help you.
|
|
|
|
|
|
Please do not do this. If anyone has an answer to your question they will post it. If no one has an answer to your question then you are out of luck and will have to try debugging it yourself. Remember that people here offer advice and help in their own time, and at no cost to you, and many of them already have full-time jobs to do during the day.
Use the best guess
|
|
|
|
|
|
Hi,
I'm working on a school managment web application i want to use a html5/css3 login page but i have to verify if the login and password matches the login and password on the database(SQL Server), if the login or the password do not match i have to show a tooltip on the same web page but i don't know how
Please Help Me
Thank You!
modified 7-Mar-22 21:01pm.
|
|
|
|
|
|
You'll have to call a webservice passing in the values submitted. jQuery has an .ajax method which makes calling web services easy. See http://api.jquery.com/jQuery.ajax/[^]
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
As per me you can use Jquery Ajax post and check autentication from SQL Db
|
|
|
|
|
Thank you all for the help i'll use AJAX wit SQL DB
modified 7-Mar-22 21:01pm.
|
|
|
|
|
When i try to open the "Web.SiteMap file in My C# (Asp.net), its getting error as :
"Value does not fall within the expected range".
Due to this issue unable to change Web.SiteMap.
I've been scratching my head with no luck.
|
|
|
|
|
Deleted the .suo file found in the solution main directory and see if that helps.
|
|
|
|
|
|
Hi all,
[I am trying to bind a gridview from a table and updation records in another table]
Actually I have two sql tables, named mtblVehicle_Booking and mtblLog_Book. In both tables all columns are same but mtblLog_Book is having 2 more columns KM_Start and KM_End.
Actually I am binding the gridview from mtblVehicle_Booking table (which don't have KM_Start and KM_End columns). The other side I have given edit option in gridview, but when I need to edit this gridview , the colums KM_Start and KM_End should come in that gridview as editing form and after updating the gridview the updated information should be seen in the gridview.
How can I accomplish this.
you can take it as a Gridview bounded with one table but when it gets update this should be partially bounded with the other table with updated information and rest of the gridview should bounded with the first one.
Suppose if gridview is having 5 rows from table1 one and if I edit two rows for updation the table2 then the gridview should show these 2 rows from table2 and the rest rows from table1 which actually has bot been updated.
|
|
|
|
|
You may be able to intercept the update during either the datasource Update event or the GridView updateRow event.
|
|
|
|
|
1st I'm a beginner MVC developer!
At any rate I wanted to add Facebook login to my (personal) website and didn't want to use the build in authentication (why bother the user with one more very forgettable useless password?)
So I deleted all authorization code and I have an account controller which take the facebook id and check it against Facebook server and set up a Session property with relevant Facebook data
now when I add an [Auhorize] attribute on my method it doesn't work (normal)
I wonder how I could setup the user!
I have code which create an IPrincipal (from facebook info) and set it to the HttpContext.User but it's lost on next query.
I tried override myControl.Initialize(RequestConterxt) and setup the current user (as in request.HttpContext.User = ...)
But I got a stranger error when I do that (which involve none of my code!!!!!):
[NullReferenceException: Object reference not set to an instance of an object.]
System.Web.Mvc.Controller.PossiblyLoadTempData() +52
System.Web.Mvc.Controller.BeginExecuteCore(AsyncCallback callback, Object state) +92
System.Web.Mvc.Async.WrappedAsyncResult`1.Begin(AsyncCallback callback, Object state, Int32 timeout) +161
System.Web.Mvc.Async.AsyncResultWrapper.Begin(AsyncCallback callback, Object state, BeginInvokeDelegate beginDelegate, EndInvokeDelegate`1 endDelegate, Object tag, Int32 timeout) +92
System.Web.Mvc.Async.AsyncResultWrapper.Begin(AsyncCallback callback, Object state, BeginInvokeDelegate beginDelegate, EndInvokeDelegate endDelegate, Object tag, Int32 timeout) +97
System.Web.Mvc.Async.AsyncResultWrapper.Begin(AsyncCallback callback, Object state, BeginInvokeDelegate beginDelegate, EndInvokeDelegate endDelegate, Object tag) +53
System.Web.Mvc.Controller.BeginExecute(RequestContext requestContext, AsyncCallback callback, Object state) +417
System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.BeginExecute(RequestContext requestContext, AsyncCallback callback, Object state) +49
System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__2(AsyncCallback asyncCallback, Object asyncState) +127
System.Web.Mvc.Async.WrappedAsyncResult`1.Begin(AsyncCallback callback, Object state, Int32 timeout) +161
System.Web.Mvc.Async.AsyncResultWrapper.Begin(AsyncCallback callback, Object state, BeginInvokeDelegate beginDelegate, EndInvokeDelegate`1 endDelegate, Object tag, Int32 timeout) +92
System.Web.Mvc.Async.AsyncResultWrapper.Begin(AsyncCallback callback, Object state, BeginInvokeDelegate beginDelegate, EndInvokeDelegate endDelegate, Object tag, Int32 timeout) +97
System.Web.Mvc.Async.AsyncResultWrapper.Begin(AsyncCallback callback, Object state, BeginInvokeDelegate beginDelegate, EndInvokeDelegate endDelegate, Object tag) +53
System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state) +373
System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContext httpContext, AsyncCallback callback, Object state) +88
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) +50
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +301
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
To summarize how could I use the [Authorize] attribute with my facebook user info?
|
|
|
|
|
Hello,
I am working on an mvc site. I understand the concept of the Model, however we are forced to work with the existance of our main frame. The data comes back in the form of a parameter block (fixed structure defining each field and it's length). This transaction to the mainframe would occur outside the controller (obviously). So to move the data from the transaction to something the controller uses can either be done with it's own class (my company calls them entities) or to double purpose the model as the information from the mainframe would basicaly (with same additions) be the fields of the model. Hopefuly all that made sense.
So the question is: do I create entity class and transfer all the data(properties) into the model after every tranasction once the fields are returned to the controller or do I double purpose the model by using it as the entity as well with the understanding that these fields that aren't to be used in the view would show up because the model fields and entity fields are mingled together?
Any advise would be greatly appreciated...
Nathan
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
|
|
|
|
|
Hi,
I'm developing a multiple-city Visitor's system. I want to create a Login page with following details:
Username, Password, City & Gate_Name.
I need to know how should I proceed with creation of tables and then the code.
The City & Gate_Name should be nested. When a city is selected, then only the appropriate gate-name must be displayed in drop-down box below.
Initially, Username & Password must be checked.
If they do not match, an error message must be generated.
If they match, then the associated city & gate-name must be checked.
If they do not match, an error message must be generated.
If all the details match, then a Session by UserID must be created and the user must be redirected to the Home Page.
A user allotted a particular gate cannot Login from any other city or any other gate.
Please help me with this Login Issue.
Thanks.
|
|
|
|
|
You have all the requirements and workflow with you. What exactly is troubling/stopping you from implementing it?
For table structure:
MstUser
UserID UserName Password CityID GateID
MstCity
CityID CityName
MstGate
GateID GateName CityID
Now, start the implementation that is pretty straight forward.
|
|
|
|
|
This article shows how to use the login and membership APIs with custom user information.
Understanding and Implementing ASP.NET Custom Forms Authentication[^]
Although you will have to add fields for City & Gate_Name and custom logic to check it. But the overall philosophy and working will remain the same as it is in this article.
Twenty years from now you will be more disappointed by the things that you didn't do than by the ones you did do. So throw off the bowlines. Sail away from the safe harbor. Catch the trade winds in your sails. Explore, Dream. Discover.
|
|
|
|
|